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

View File

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

View File

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