altTab: use 'selected' pseudo-style for selected item
This makes it consistent with other parts of the UI and will let the a11y code use the rule "has_style_pseudo_class('selected') => ATK_STATE_SELECTED" https://bugzilla.gnome.org/show_bug.cgi?id=637830
This commit is contained in:
parent
ca09595350
commit
7d44c666ff
@ -993,6 +993,15 @@ StTooltip StLabel {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.switcher-list .item-box:outlined {
|
||||
padding: 6px;
|
||||
border: 2px solid rgba(85,85,85,1.0);
|
||||
}
|
||||
|
||||
.switcher-list .item-box:selected {
|
||||
background: rgba(255,255,255,0.33);
|
||||
}
|
||||
|
||||
.switcher-list .thumbnail-box {
|
||||
padding: 2px;
|
||||
spacing: 4px;
|
||||
@ -1002,18 +1011,6 @@ StTooltip StLabel {
|
||||
width: 256px;
|
||||
}
|
||||
|
||||
.switcher-list .outlined-item-box {
|
||||
padding: 6px;
|
||||
border: 2px solid rgba(85,85,85,1.0);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.switcher-list .selected-item-box {
|
||||
padding: 8px;
|
||||
border-radius: 8px;
|
||||
background: rgba(255,255,255,0.33);
|
||||
}
|
||||
|
||||
.switcher-list .separator {
|
||||
width: 1px;
|
||||
background: rgba(255,255,255,0.33);
|
||||
|
@ -604,16 +604,18 @@ SwitcherList.prototype = {
|
||||
},
|
||||
|
||||
highlight: function(index, justOutline) {
|
||||
if (this._highlighted != -1)
|
||||
this._items[this._highlighted].style_class = 'item-box';
|
||||
if (this._highlighted != -1) {
|
||||
this._items[this._highlighted].remove_style_pseudo_class('outlined');
|
||||
this._items[this._highlighted].remove_style_pseudo_class('selected');
|
||||
}
|
||||
|
||||
this._highlighted = index;
|
||||
|
||||
if (this._highlighted != -1) {
|
||||
if (justOutline)
|
||||
this._items[this._highlighted].style_class = 'outlined-item-box';
|
||||
this._items[this._highlighted].add_style_pseudo_class('outlined');
|
||||
else
|
||||
this._items[this._highlighted].style_class = 'selected-item-box';
|
||||
this._items[this._highlighted].add_style_pseudo_class('selected');
|
||||
}
|
||||
|
||||
let monitor = global.get_primary_monitor();
|
||||
@ -859,9 +861,11 @@ AppSwitcher.prototype = {
|
||||
while(this._items.length > 1 && this._items[j].style_class != 'item-box') {
|
||||
j++;
|
||||
}
|
||||
let iconPadding = this._items[j].get_theme_node().get_horizontal_padding();
|
||||
let themeNode = this._items[j].get_theme_node();
|
||||
let iconPadding = themeNode.get_horizontal_padding();
|
||||
let iconBorder = themeNode.get_border_width(St.Side.LEFT) + themeNode.get_border_width(St.Side.RIGHT);
|
||||
let [iconMinHeight, iconNaturalHeight] = this.icons[j].label.get_preferred_height(-1);
|
||||
let iconSpacing = iconNaturalHeight + iconPadding;
|
||||
let iconSpacing = iconNaturalHeight + iconPadding + iconBorder;
|
||||
let totalSpacing = this._list.spacing * (this._items.length - 1);
|
||||
if (this._separator)
|
||||
totalSpacing += this._separator.width + this._list.spacing;
|
||||
|
Loading…
Reference in New Issue
Block a user