mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-01 10:41:03 +02:00
fix(upower): icon outside button
This moves the upower battery icon to inside the button, moving it before the label for consistency.
This commit is contained in:
parent
b9740cba8f
commit
a6b686624b
2 changed files with 17 additions and 16 deletions
|
@ -41,7 +41,7 @@ pub struct UpowerProperties {
|
|||
time_to_empty: i64,
|
||||
}
|
||||
|
||||
impl Module<gtk::Box> for UpowerModule {
|
||||
impl Module<gtk::Button> for UpowerModule {
|
||||
type SendMessage = UpowerProperties;
|
||||
type ReceiveMessage = ();
|
||||
|
||||
|
@ -143,7 +143,7 @@ impl Module<gtk::Box> for UpowerModule {
|
|||
self,
|
||||
context: WidgetContext<Self::SendMessage, Self::ReceiveMessage>,
|
||||
info: &ModuleInfo,
|
||||
) -> Result<ModuleWidget<gtk::Box>> {
|
||||
) -> Result<ModuleWidget<Button>> {
|
||||
let icon_theme = info.icon_theme.clone();
|
||||
let icon = gtk::Image::new();
|
||||
add_class(&icon, "icon");
|
||||
|
@ -154,15 +154,15 @@ impl Module<gtk::Box> for UpowerModule {
|
|||
.build();
|
||||
add_class(&label, "label");
|
||||
|
||||
let container = gtk::Box::new(Orientation::Horizontal, 0);
|
||||
add_class(&container, "upower");
|
||||
let container = gtk::Box::new(Orientation::Horizontal, 5);
|
||||
add_class(&container, "contents");
|
||||
|
||||
let button = Button::new();
|
||||
add_class(&button, "button");
|
||||
|
||||
button.add(&label);
|
||||
container.add(&button);
|
||||
container.add(&icon);
|
||||
container.add(&label);
|
||||
button.add(&container);
|
||||
|
||||
let orientation = info.bar_position.get_orientation();
|
||||
button.connect_clicked(move |button| {
|
||||
|
@ -189,7 +189,7 @@ impl Module<gtk::Box> for UpowerModule {
|
|||
let popup = self.into_popup(context.controller_tx, context.popup_rx, info);
|
||||
|
||||
Ok(ModuleWidget {
|
||||
widget: container,
|
||||
widget: button,
|
||||
popup,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue