1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-03 11:41:04 +02:00

feat: more positioning options (#23)

* feat: more positioning options

Can now display the bar on the left/right, and avoid anchoring to edges to centre the bar.

BREAKING CHANGE: The `left` and `right` config options have been renamed to `start` and `end`
This commit is contained in:
Jake Stanger 2022-10-15 16:27:25 +01:00 committed by GitHub
parent 1b853bcb71
commit 06cfad62e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 254 additions and 83 deletions

View file

@ -14,6 +14,7 @@ pub mod tray;
pub mod workspaces;
use crate::config::BarPosition;
use crate::popup::ButtonGeometry;
use color_eyre::Result;
use derive_builder::Builder;
use glib::IsA;
@ -32,7 +33,7 @@ pub enum ModuleLocation {
pub struct ModuleInfo<'a> {
pub app: &'a Application,
pub location: ModuleLocation,
pub bar_position: &'a BarPosition,
pub bar_position: BarPosition,
pub monitor: &'a Monitor,
pub output_name: &'a str,
pub module_name: &'a str,
@ -43,11 +44,10 @@ pub enum ModuleUpdateEvent<T> {
/// Sends an update to the module UI
Update(T),
/// Toggles the open state of the popup.
/// Takes the button X position and width.
TogglePopup((i32, i32)),
TogglePopup(ButtonGeometry),
/// Force sets the popup open.
/// Takes the button X position and width.
OpenPopup((i32, i32)),
OpenPopup(ButtonGeometry),
/// Force sets the popup closed.
ClosePopup,
}