diff --git a/data/Application.css b/data/Application.css index 379e8968..622e87f1 100644 --- a/data/Application.css +++ b/data/Application.css @@ -66,6 +66,45 @@ launcher progressbar progress { min-width: 0; } +launcher.small progressbar { + margin-left: 4px; + margin-right: 4px; + margin-bottom: 4px; +} + +launcher.small progressbar trough { + min-height: 1px; +} + +launcher.small progressbar progress { + min-height: 1px; +} + +launcher.large progressbar trough { + min-height: 6px; +} + +launcher.large progressbar { + margin-left: 7px; + margin-right: 7px; + margin-bottom: 7px; +} + +launcher.large progressbar progress { + min-height: 6px; +} + +launcher.small .badge { + min-width: 18px; + min-height: 18px; +} + +launcher.large .badge { + font-size: 16px; + min-width: 28px; + min-height: 28px; +} + tooltip { margin-bottom: 0.5em; } diff --git a/src/BaseItem.vala b/src/BaseItem.vala index 64804034..55e0bf84 100644 --- a/src/BaseItem.vala +++ b/src/BaseItem.vala @@ -4,6 +4,9 @@ */ public class Dock.BaseItem : Gtk.Box { + private const string CSS_CLASS_LARGE = "large"; + private const string CSS_CLASS_SMALL = "small"; + public enum State { ACTIVE, INACTIVE, @@ -30,9 +33,27 @@ public class Dock.BaseItem : Gtk.Box { */ public Group group { get; construct; } - public int icon_size { get; set; } public new string tooltip_text { get; set; } + private int _icon_size; + public int icon_size { + get { + return _icon_size; + } + set { + _icon_size = value; + + remove_css_class (CSS_CLASS_LARGE); + remove_css_class (CSS_CLASS_SMALL); + + if (icon_size >= 64) { + add_css_class (CSS_CLASS_LARGE); + } else if (icon_size <= 32) { + add_css_class (CSS_CLASS_SMALL); + } + } + } + private double _current_pos = 0.0; public double current_pos { get { return _current_pos; } @@ -134,10 +155,7 @@ public class Dock.BaseItem : Gtk.Box { bind_property ("tooltip-text", tooltip_label, "label"); - icon_size = dock_settings.get_int ("icon-size"); - dock_settings.changed["icon-size"].connect (() => { - icon_size = dock_settings.get_int ("icon-size"); - }); + dock_settings.bind ("icon-size", this, "icon-size", GET); fade = new Adw.TimedAnimation ( this, 0, 1,