[gnome-shell/wip/jimmac/dash-icon-spacing: 26/72] overview: Move search entry to ControlsManager
- From: Jakub Steiner <jimmac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/jimmac/dash-icon-spacing: 26/72] overview: Move search entry to ControlsManager
- Date: Tue, 2 Feb 2021 11:58:18 +0000 (UTC)
commit b9748b90d4de4a9e6474f725e4606e7066e2cba9
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Dec 30 17:02:14 2020 -0300
overview: Move search entry to ControlsManager
Next commit will tie all these widgets up with a single
layout manager, and we need to control the search entry
position.
Move it to OverviewControls.ControlsManager.
data/theme/gnome-shell-sass/widgets/_overview.scss | 4 ++++
js/ui/overview.js | 22 ++-----------------
js/ui/overviewControls.js | 25 ++++++++++++++++++++--
3 files changed, 29 insertions(+), 22 deletions(-)
---
diff --git a/data/theme/gnome-shell-sass/widgets/_overview.scss
b/data/theme/gnome-shell-sass/widgets/_overview.scss
index 3af2ed8224..b9946a4e17 100644
--- a/data/theme/gnome-shell-sass/widgets/_overview.scss
+++ b/data/theme/gnome-shell-sass/widgets/_overview.scss
@@ -4,6 +4,10 @@
spacing: 24px;
}
+#overview-group {
+ spacing: 24px;
+}
+
#overviewGroup {
background-color: #241f31;
}
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 1100d0d7c6..00e998bee7 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -91,26 +91,8 @@ class OverviewActor extends St.BoxLayout {
});
this.add_actor(panelGhost);
- this._searchEntry = new St.Entry({
- style_class: 'search-entry',
- /* Translators: this is the text displayed
- in the search entry when no search is
- active; it should not exceed ~30
- characters. */
- hint_text: _('Type to search'),
- track_hover: true,
- can_focus: true,
- });
- this._searchEntry.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
- let searchEntryBin = new St.Bin({
- child: this._searchEntry,
- x_align: Clutter.ActorAlign.CENTER,
- });
- this.add_actor(searchEntryBin);
-
- this._controls = new OverviewControls.ControlsManager(this._searchEntry);
- // Add our same-line elements after the search entry
+ this._controls = new OverviewControls.ControlsManager();
this.add_child(this._controls);
}
@@ -119,7 +101,7 @@ class OverviewActor extends St.BoxLayout {
}
get searchEntry() {
- return this._searchEntry;
+ return this._controls.searchEntry;
}
get viewSelector() {
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index af420c5289..c66aea7ef7 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -46,7 +46,7 @@ class DashFader extends St.Widget {
var ControlsManager = GObject.registerClass(
class ControlsManager extends St.Widget {
- _init(searchEntry) {
+ _init() {
super._init({
layout_manager: new Clutter.BinLayout(),
x_expand: true,
@@ -54,6 +54,22 @@ class ControlsManager extends St.Widget {
clip_to_allocation: true,
});
+ this._searchEntry = new St.Entry({
+ style_class: 'search-entry',
+ /* Translators: this is the text displayed
+ in the search entry when no search is
+ active; it should not exceed ~30
+ characters. */
+ hint_text: _('Type to search'),
+ track_hover: true,
+ can_focus: true,
+ });
+ this._searchEntry.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
+ const searchEntryBin = new St.Bin({
+ child: this._searchEntry,
+ x_align: Clutter.ActorAlign.CENTER,
+ });
+
this.dash = new Dash.Dash();
this._dashFader = new DashFader(this.dash);
@@ -74,7 +90,7 @@ class ControlsManager extends St.Widget {
workspaceManager.connect('notify::n-workspaces',
this._updateAdjustment.bind(this));
- this.viewSelector = new ViewSelector.ViewSelector(searchEntry,
+ this.viewSelector = new ViewSelector.ViewSelector(this._searchEntry,
this._workspaceAdjustment, this.dash.showAppsButton);
this._group = new St.BoxLayout({
@@ -91,6 +107,7 @@ class ControlsManager extends St.Widget {
});
box.add_child(this.viewSelector);
+ this._group.add_actor(searchEntryBin);
this._group.add_child(box);
this._group.add_actor(this._dashFader);
@@ -113,4 +130,8 @@ class ControlsManager extends St.Widget {
this._workspaceAdjustment.remove_transition('value');
this._workspaceAdjustment.value = activeIndex;
}
+
+ get searchEntry() {
+ return this._searchEntry;
+ }
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]