mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 14:51:04 +02:00
feat: Add orientation support for custom label and button
This commit is contained in:
parent
702b0a63bf
commit
70b2c592b2
11 changed files with 145 additions and 39 deletions
|
@ -101,15 +101,10 @@ impl Module<Button> for ClockModule {
|
|||
info: &ModuleInfo,
|
||||
) -> Result<ModuleParts<Button>> {
|
||||
let button = Button::new();
|
||||
let label = if matches!(self.orientation, ModuleOrientation::Vertical) {
|
||||
Label::builder()
|
||||
.angle(info.bar_position.get_angle())
|
||||
.use_markup(true)
|
||||
} else {
|
||||
Label::builder()
|
||||
.use_markup(true)
|
||||
|
||||
}.build();
|
||||
let label = Label::builder()
|
||||
.angle(self.orientation.to_angle())
|
||||
.use_markup(true)
|
||||
.build();
|
||||
button.add(&label);
|
||||
|
||||
let tx = context.tx.clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue