Add a special style class for menu popover button

We want to have a non-osd popover in the button that is placed on OSD headerbar. This is something unusual that Adwaita does not have, so create a custom style that will use common values from user system theme.
This commit is contained in:
Rafał Dzięgiel
2021-02-19 10:12:47 +01:00
parent e7b446ca9f
commit 6400d251c2
2 changed files with 13 additions and 0 deletions

View File

@@ -21,6 +21,18 @@ radio {
.osdheaderbar button {
border: transparent;
}
/* Non-osd style for popover menu */
.menupopover label {
color: @theme_text_color;
}
.menupopover arrow {
background: @theme_base_color;
border-color: @insensitive_base_color;
}
.menupopover contents {
background: @theme_base_color;
border-color: @insensitive_base_color;
}
.adwrounded.csd {
border-radius: 8px;
}

View File

@@ -35,6 +35,7 @@ class ClapperHeaderBarBase extends Gtk.Box
});
const mainMenuModel = uiBuilder.get_object('mainMenu');
const mainMenuPopover = new HeaderBarPopover(mainMenuModel);
mainMenuPopover.add_css_class('menupopover');
this.menuButton.set_popover(mainMenuPopover);
this.menuButton.add_css_class('circular');
this.menuWidget.append(this.menuButton);