Skip to content

Commit

Permalink
fix: inability for popover pin button to be themed (#563)
Browse files Browse the repository at this point in the history
* fix: inability for popover pin button to be themed

Theme developers should apply same .alert as done for notification icon

* fix: missing newline at end of icons meson.build file
  • Loading branch information
JoshStrobl authored Apr 18, 2024
1 parent bf436db commit ee9807a
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 117 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions data/icons/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ app_icons = [
status_icons = [
join_paths('.', 'status', 'num-lock-symbolic.svg'),
join_paths('.', 'status', 'caps-lock-symbolic.svg'),
join_paths('.', 'status', 'budgie-app-favorited.svg'),
join_paths('.', 'status', 'budgie-app-unfavorited.svg'),
join_paths('.', 'status', 'budgie-caffeine-cup-full.svg'),
join_paths('.', 'status', 'budgie-caffeine-cup-empty.svg'),
]

symbolic_emblems_icons = [
join_paths('.', 'emblems', 'budgie-emblem-favorite-symbolic.svg'),
]

install_data(
actions_icons,
install_dir: join_paths(datadir, 'icons', 'hicolor', 'scalable', 'actions'),
Expand All @@ -46,3 +48,8 @@ install_data(
status_icons,
install_dir: join_paths(datadir, 'icons', 'hicolor', 'scalable', 'status'),
)

install_data(
symbolic_emblems_icons,
install_dir: join_paths(datadir, 'icons', 'hicolor', 'symbolic', 'emblems'),
)
22 changes: 0 additions & 22 deletions data/icons/status/budgie-app-unfavorited.svg

This file was deleted.

17 changes: 10 additions & 7 deletions src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ public class ButtonPopover : Budgie.Popover {
get { return _pinned; }
construct set {
_pinned = value;

if (pin_button == null) return;

pin_button.image = new Gtk.Image.from_icon_name("budgie-app-" +(!_pinned ? "unfavorited" : "favorited"), Gtk.IconSize.SMALL_TOOLBAR);
pin_button.tooltip_text = _pinned ? _("Unfavorite") : _("Favorite");

if (value) {
pin_icon.get_style_context().add_class("alert");
} else {
pin_icon.get_style_context().remove_class("alert");
}
}
}

private Gtk.Image pin_icon;
private Gtk.Stack? stack;
private Gtk.ListBox? desktop_actions;
private Gtk.ListBox? windows;
Expand Down Expand Up @@ -86,9 +90,8 @@ public class ButtonPopover : Budgie.Popover {
}
}

Gtk.Image pinned_icon;

pinned_icon = new Gtk.Image.from_icon_name("budgie-app-" +(!_pinned ? "unfavorited" : "favorited"), Gtk.IconSize.SMALL_TOOLBAR);
pin_icon = new Gtk.Image.from_icon_name("budgie-emblem-favorite-symbolic", Gtk.IconSize.SMALL_TOOLBAR);
pin_icon.get_style_context().add_class("icon-popover-pin");

close_all_button = new Gtk.Button.from_icon_name("list-remove-all-symbolic", Gtk.IconSize.SMALL_TOOLBAR) {
tooltip_text = _("Close all windows"),
Expand All @@ -101,7 +104,7 @@ public class ButtonPopover : Budgie.Popover {

if (app != null) {
pin_button = new Gtk.Button() {
image = pinned_icon,
image = pin_icon,
tooltip_text = _pinned ? _("Unfavorite") : _("Favorite"),
relief = Gtk.ReliefStyle.NONE,
};
Expand Down
190 changes: 105 additions & 85 deletions src/theme/3.20/_main.scss
Original file line number Diff line number Diff line change
@@ -1,158 +1,178 @@
// Container for both the "panel" area and the shadow. Wise to keep
// this transparent..
.budgie-container { background-color: transparent; }
.budgie-container {
background-color: transparent;
}

// Underscores
%underscores {
@include underscores('button.flat');
@include underscores("button.flat");
}

// Panel
.budgie-panel {
@include budgie_panel(button, separator, 'background-color');
@include budgie_panel(button, separator, "background-color");
}

// Panel Borders
@include borders($pos_list);

// Workspace Switcher
@include workspaces(frame,button);
@include workspaces(frame, button);

// Budgie Menu
.budgie-menu {
@include budgie-menu('icon-effect', 'entry.search', 'image', 'disabled',
'label', 'undershoot', 'overshoot');
@include budgie-menu(
"icon-effect",
"entry.search",
"image",
"disabled",
"label",
"undershoot",
"overshoot"
);
}

// Menu Button
@include budgie_menu_button('button');
@include budgie_menu_button("button");

// User Menu
@include budgie_user_menu(separator, 'background-color');
@include budgie_user_menu(separator, "background-color");

// Places Menu
@include places_menu(button, list, row, entry);


// Budgie styled Gtk Menus
.budgie-menubar {
@include budgie_menubar(menu, arrow, menuitem, accelerator);
arrow {
min-width:16px;
min-height:16px;
@include budgie_menubar(menu, arrow, menuitem, accelerator);
arrow {
min-width: 16px;
min-height: 16px;
}

menuitem {
check,
radio {
min-height: 16px;
min-width: 16px;
}
}
}

menuitem {
check, radio {
min-height: 16px;
min-width: 16px;
}
}
// Icon Popover
.icon-popover {
.icon-popover-pin.alert {
color: $alert_color;
}
}

// Session Dialog
.budgie-session-dialog {
@extend %widgets;
@include budgie_session_dialog(button);
@extend %widgets;
@include budgie_session_dialog(button);
}

// Power Dialog
.budgie-power-dialog {
@extend %widgets;
@include budgie_power_dialog();
@extend %widgets;
@include budgie_power_dialog();
}

// Run Dialog
.budgie-run-dialog {
@extend .budgie-session-dialog;
@extend .budgie-session-dialog;

> box {
border-radius: 8px;
background-color: lighten($panel_bg, 10%);
}
> box {
border-radius: 8px;
background-color: lighten($panel_bg, 10%);
}

entry.search, entry.search:focus {
@extend %budgie_run_dialog_entry;
entry.search,
entry.search:focus {
@extend %budgie_run_dialog_entry;

background-color: transparent;
background-color: transparent;

image {
@extend %budgie_run_dialog_image;
}
image {
@extend %budgie_run_dialog_image;
}
}

list row.activatable {
@extend %reset_style;
list row.activatable {
@extend %reset_style;

background-color: transparent;
transition: background-color 170ms ease-out;
background-color: transparent;
transition: background-color 170ms ease-out;

&:selected {
background-color: $selected_bg_color;
&:selected {
background-color: $selected_bg_color;

.dim-label {
opacity: 1;
}
}

&:hover { background-color: transparentize(white, 0.9); }

&:hover .dim-label, &:active .dim-label {
opacity: 1;
}
.dim-label {
opacity: 1;
}
}

list row:selected .dim-label {
opacity: 1;
&:hover {
background-color: transparentize(white, 0.9);
}

scrolledwindow {
background-color: $panel_bg;
border-top: 1px solid darken($entry_border, 5%);
&:hover .dim-label,
&:active .dim-label {
opacity: 1;
}
}

list row:selected .dim-label {
opacity: 1;
}

scrolledwindow {
background-color: $panel_bg;
border-top: 1px solid darken($entry_border, 5%);
}
}

// Alt+tab switcher in Budgie
.budgie-switcher-window {
@extend .budgie-notification-window;

> decoration {
box-shadow: 0 2px 4px $panel_bg;
border-radius: 8px;
}

> box {
padding: 6px;
border-radius: 8px;
}

// Flowbox
flowbox {
color: $fg_color;
padding: 4px;
}
flowboxchild {
@include budgie_switcher_child(disabled, label);
}
@extend .budgie-notification-window;

> decoration {
box-shadow: 0 2px 4px $panel_bg;
border-radius: 8px;
}

> box {
padding: 6px;
border-radius: 8px;
}

// Flowbox
flowbox {
color: $fg_color;
padding: 4px;
}
flowboxchild {
@include budgie_switcher_child(disabled, label);
}
}

// Icon Tasklist
.budgie-panel {
@include icon_tasklist('button.flat');
@include icon_tasklist("button.flat");

button.flat.launcher {
@extend %reset_style;
outline-color: transparent;
border-radius: 0;
}
button.flat.launcher {
@extend %reset_style;
outline-color: transparent;
border-radius: 0;
}
}

// Raven
.raven {
@include raven(button);
.raven-header {
min-height: 32px;
}
@include raven(button);
.raven-header {
min-height: 32px;
}
}
@include raven-trigger(button);
@include raven-mpris(button);

0 comments on commit ee9807a

Please sign in to comment.