mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-01 10:41:03 +02:00
feat: add support for showing bar at top of screen
This commit is contained in:
parent
19d009fe5b
commit
a358037d3e
8 changed files with 77 additions and 15 deletions
|
@ -30,7 +30,7 @@ impl Module<Button> for ClockModule {
|
|||
fn into_widget(self, info: &ModuleInfo) -> Button {
|
||||
let button = Button::new();
|
||||
|
||||
let popup = Popup::new("popup-clock", info.app, Orientation::Vertical);
|
||||
let popup = Popup::new("popup-clock", info.app, Orientation::Vertical, info.bar_position);
|
||||
popup.add_clock_widgets();
|
||||
|
||||
button.show_all();
|
||||
|
|
|
@ -207,7 +207,7 @@ impl Module<gtk::Box> for LauncherModule {
|
|||
|
||||
let mut sway = Client::connect().unwrap();
|
||||
|
||||
let popup = Popup::new("popup-launcher", info.app, Orientation::Vertical);
|
||||
let popup = Popup::new("popup-launcher", info.app, Orientation::Vertical, info.bar_position);
|
||||
let container = gtk::Box::new(Orientation::Horizontal, 0);
|
||||
|
||||
let (ui_tx, mut ui_rx) = mpsc::channel(32);
|
||||
|
|
|
@ -18,6 +18,7 @@ use glib::IsA;
|
|||
use gtk::{Application, Widget};
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde_json::Value;
|
||||
use crate::config::BarPosition;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum ModuleLocation {
|
||||
|
@ -29,6 +30,7 @@ pub enum ModuleLocation {
|
|||
pub struct ModuleInfo<'a> {
|
||||
pub app: &'a Application,
|
||||
pub location: ModuleLocation,
|
||||
pub bar_position: &'a BarPosition
|
||||
}
|
||||
|
||||
pub trait Module<W>
|
||||
|
|
|
@ -93,7 +93,7 @@ impl Module<Button> for MpdModule {
|
|||
|
||||
let (ui_tx, mut ui_rx) = mpsc::channel(32);
|
||||
|
||||
let popup = Popup::new("popup-mpd", info.app, Orientation::Horizontal);
|
||||
let popup = Popup::new("popup-mpd", info.app, Orientation::Horizontal, info.bar_position);
|
||||
let mpd_popup = MpdPopup::new(popup, ui_tx);
|
||||
|
||||
let (tx, rx) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue