[dash] Port search section headers to CSS
Experimented with moving the (see all) into a tooltip, but given that we're not emphasizing the drilldown, removed for now. https://bugzilla.gnome.org/show_bug.cgi?id=600734
This commit is contained in:
parent
bf68f9f0cf
commit
426d7bc515
@ -93,6 +93,17 @@ StTooltip {
|
|||||||
spacing: 12px;
|
spacing: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dash-search-section-header {
|
||||||
|
padding: 6px 0px;
|
||||||
|
spacing: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #bbbbbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dash-search-section-title, dash-search-section-count {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
#searchEntry {
|
#searchEntry {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
border-bottom: 1px solid #262626;
|
border-bottom: 1px solid #262626;
|
||||||
|
@ -21,8 +21,6 @@ const Main = imports.ui.main;
|
|||||||
|
|
||||||
const DEFAULT_PADDING = 4;
|
const DEFAULT_PADDING = 4;
|
||||||
const DEFAULT_SPACING = 4;
|
const DEFAULT_SPACING = 4;
|
||||||
const DASH_SECTION_PADDING = 6;
|
|
||||||
const DASH_SECTION_SPACING = 40;
|
|
||||||
|
|
||||||
const BACKGROUND_COLOR = new Clutter.Color();
|
const BACKGROUND_COLOR = new Clutter.Color();
|
||||||
BACKGROUND_COLOR.from_pixel(0x000000c0);
|
BACKGROUND_COLOR.from_pixel(0x000000c0);
|
||||||
@ -489,41 +487,19 @@ function SearchSectionHeader(title, onClick) {
|
|||||||
|
|
||||||
SearchSectionHeader.prototype = {
|
SearchSectionHeader.prototype = {
|
||||||
_init : function(title, onClick) {
|
_init : function(title, onClick) {
|
||||||
let box = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
|
this.actor = new St.Button({ style_class: "dash-search-section-header",
|
||||||
padding_top: DASH_SECTION_PADDING,
|
x_fill: true,
|
||||||
padding_bottom: DASH_SECTION_PADDING,
|
y_fill: true });
|
||||||
spacing: DEFAULT_SPACING });
|
let box = new St.BoxLayout();
|
||||||
let titleText = new Clutter.Text({ color: BRIGHTER_TEXT_COLOR,
|
this.actor.set_child(box);
|
||||||
font_name: 'Sans Bold 12px',
|
let titleText = new St.Label({ style_class: "dash-search-section-title",
|
||||||
text: title });
|
text: title });
|
||||||
this.tooltip = new Clutter.Text({ color: BRIGHTER_TEXT_COLOR,
|
this.countText = new St.Label({ style_class: "dash-search-section-count" });
|
||||||
font_name: 'Sans 12px',
|
|
||||||
text: _("(see all)") });
|
|
||||||
this.countText = new Clutter.Text({ color: BRIGHTER_TEXT_COLOR,
|
|
||||||
font_name: 'Sans Bold 14px' });
|
|
||||||
|
|
||||||
box.append(titleText, Big.BoxPackFlags.NONE);
|
box.add(titleText);
|
||||||
box.append(this.tooltip, Big.BoxPackFlags.NONE);
|
box.add(this.countText, { expand: true, x_fill: false, x_align: St.Align.END });
|
||||||
box.append(this.countText, Big.BoxPackFlags.END);
|
|
||||||
|
|
||||||
this.tooltip.hide();
|
this.actor.connect('clicked', onClick);
|
||||||
|
|
||||||
let button = new Button.Button(box, PRELIGHT_COLOR, BACKGROUND_COLOR,
|
|
||||||
TEXT_COLOR);
|
|
||||||
button.actor.height = box.height;
|
|
||||||
button.actor.padding_left = DEFAULT_PADDING;
|
|
||||||
button.actor.padding_right = DEFAULT_PADDING;
|
|
||||||
|
|
||||||
button.actor.connect('activate', onClick);
|
|
||||||
button.actor.connect('notify::hover', Lang.bind(this, this._updateTooltip));
|
|
||||||
this.actor = button.actor;
|
|
||||||
},
|
|
||||||
|
|
||||||
_updateTooltip : function(actor) {
|
|
||||||
if (actor.hover)
|
|
||||||
this.tooltip.show();
|
|
||||||
else
|
|
||||||
this.tooltip.hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user