feat: added sway subconfig, always include default css

This commit is contained in:
imgurbot12 2023-08-08 12:29:25 -07:00
parent 610d702c47
commit ec52a89234
4 changed files with 18 additions and 14 deletions

View File

@ -0,0 +1,3 @@
# Configure RMenu to Spawn Floating in the Center of the Screen
for_window [app_id="rmenu"] floating enable

View File

@ -9,20 +9,20 @@ main {
justify-content: center; justify-content: center;
} }
div.navbar { .navbar {
top: 0; top: 0;
position: fixed; position: fixed;
overflow: hidden; overflow: hidden;
min-width: 99%; min-width: 99%;
} }
div.results { .results {
height: 100vh; height: 100vh;
margin-top: 50px; margin-top: 50px;
overflow-y: auto; overflow-y: auto;
} }
div.selected { .selected {
background-color: lightblue; background-color: lightblue;
} }
@ -34,49 +34,49 @@ input {
/* Result CSS */ /* Result CSS */
div.result, div.action { .result, .action {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: left; justify-content: left;
} }
div.result > div, div.action > div { .result > div, .action > div {
margin: 2px 5px; margin: 2px 5px;
} }
div.result > div.icon { .result > .icon {
width: 4%; width: 4%;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
div.result > div.icon > img { .result > .icon > img {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
} }
div.result > div.name { .result > .name {
width: 30%; width: 30%;
} }
div.result > div.comment { .result > .comment {
flex: 1; flex: 1;
} }
/* Action CSS */ /* Action CSS */
div.actions { .actions {
display: none; display: none;
padding-left: 5%; padding-left: 5%;
} }
div.action-name { .action-name {
width: 50%; width: 50%;
} }
div.actions.active { .actions.active {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;

View File

@ -6,7 +6,7 @@ use rmenu_plugin::Entry;
use crate::config::Keybind; use crate::config::Keybind;
use crate::state::{AppState, KeyEvent}; use crate::state::{AppState, KeyEvent};
use crate::App; use crate::{App, DEFAULT_CSS_CONTENT};
/// spawn and run the app on the configured platform /// spawn and run the app on the configured platform
pub fn run(app: App) { pub fn run(app: App) {
@ -207,6 +207,7 @@ fn App<'a>(cx: Scope<App>) -> Element {
}); });
cx.render(rsx! { cx.render(rsx! {
style { DEFAULT_CSS_CONTENT }
style { "{cx.props.css}" } style { "{cx.props.css}" }
div { div {
// onclick: |_| focus(cx), // onclick: |_| focus(cx),

View File

@ -212,7 +212,7 @@ impl Args {
Ok(css) => css, Ok(css) => css,
Err(err) => { Err(err) => {
log::error!("failed to load css: {err:?}"); log::error!("failed to load css: {err:?}");
DEFAULT_CSS_CONTENT.to_owned() "".to_owned()
} }
}; };
// load entries from configured sources // load entries from configured sources