Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lainsce committed Jan 19, 2023
1 parent 39dd6f0 commit d8ff8d0
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions lib/Widgets/AppBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ public class He.AppBar : He.Bin {
viewtitle_mini.add_css_class ("title");
main_box.add_css_class ("appbar");
main_box.remove_css_class ("flat-appbar");
if (!_show_buttons)
top_box.margin_top = 0;
else
top_box.margin_top = 0;
top_box.margin_top = 0;
} else {
if (viewtitle_widget != null) {
viewtitle_widget.set_visible (true);
Expand All @@ -106,10 +103,11 @@ public class He.AppBar : He.Bin {
viewtitle_mini.remove_css_class ("title");
main_box.add_css_class ("flat-appbar");
main_box.remove_css_class ("appbar");
if (!_show_buttons)
if (!_show_buttons) {
top_box.margin_top = 36;
else
} else {
top_box.margin_top = 0;
}
}
vadj.value_changed.connect ((a) => {
if (a.value != 0) {
Expand All @@ -127,10 +125,7 @@ public class He.AppBar : He.Bin {
viewtitle_mini.add_css_class ("title");
main_box.add_css_class ("appbar");
main_box.remove_css_class ("flat-appbar");
if (!_show_buttons)
top_box.margin_top = 0;
else
top_box.margin_top = 0;
top_box.margin_top = 0;
} else {
if (viewtitle_widget != null) {
viewtitle_widget.set_visible (true);
Expand All @@ -146,10 +141,11 @@ public class He.AppBar : He.Bin {
viewtitle_mini.remove_css_class ("title");
main_box.add_css_class ("flat-appbar");
main_box.remove_css_class ("appbar");
if (!_show_buttons)
if (!_show_buttons) {
top_box.margin_top = 36;
else
} else {
top_box.margin_top = 0;
}
}
});
}
Expand Down Expand Up @@ -318,7 +314,7 @@ public class He.AppBar : He.Bin {
labels_box.append (viewsubtitle);

btn_box.valign = Gtk.Align.END;
btn_box.margin_end = 6;
btn_box.margin_end = 12;

sub_box.append (labels_box);
sub_box.append (btn_box);
Expand All @@ -334,13 +330,25 @@ public class He.AppBar : He.Bin {
show_buttons = true;
flat = true;
main_box.add_css_class ("flat-appbar");
if (!_show_buttons) {
top_box.margin_top = 36;
} else {
top_box.margin_top = 0;
}
this.notify["show-buttons"].connect (() => {
if (!_show_buttons) {
top_box.margin_top = 36;
} else {
top_box.margin_top = 0;
}
});
}

static construct {
set_layout_manager_type (typeof (Gtk.BoxLayout));
}

~AppBar () {
title.unparent ();
this.unparent ();
}
}
}

0 comments on commit d8ff8d0

Please sign in to comment.