[gnome-shell/wip/raresv/uiTweaks] search.js: patch containing all modifications (to be broken into individual commits)



commit f1395bf9af6ad988dca8900b37d4ebd544416c94
Author: raresvis <rares visalom gmail com>
Date:   Mon Jun 19 19:16:39 2017 +0300

    search.js: patch containing all modifications (to be broken into individual commits)

 js/ui/search.js |   46 ++++++++++++++++++++++++++++++++++++----------
 1 files changed, 36 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/search.js b/js/ui/search.js
index 4d29e59..ba0c904 100644
--- a/js/ui/search.js
+++ b/js/ui/search.js
@@ -72,7 +72,7 @@ const ListSearchResult = new Lang.Class({
     Name: 'ListSearchResult',
     Extends: SearchResult,
 
-    ICON_SIZE: 64,
+    ICON_SIZE: 40,
 
     _init: function(provider, metaInfo) {
         this.parent(provider, metaInfo);
@@ -90,7 +90,7 @@ const ListSearchResult = new Lang.Class({
             content.add(icon);
         }
 
-        let details = new St.BoxLayout({ vertical: true });
+        let details = new St.BoxLayout({ vertical: false });
         content.add(details, { x_fill: true,
                                y_fill: false,
                                x_align: St.Align.START,
@@ -105,12 +105,14 @@ const ListSearchResult = new Lang.Class({
         this.actor.label_actor = title;
 
         if (this.metaInfo['description']) {
-            let description = new St.Label({ style_class: 'list-search-result-description' });
-            description.clutter_text.set_markup(this.metaInfo['description']);
+            let description = new St.Label({
+                                style_class: 'list-search-result-description',
+                                style: "margin-left: 30px;",
+                                text: this.metaInfo['description'] });
             details.add(description, { x_fill: false,
                                        y_fill: false,
                                        x_align: St.Align.START,
-                                       y_align: St.Align.END });
+                                       y_align: St.Align.MIDDLE });
         }
     }
 });
@@ -188,7 +190,7 @@ const SearchResultsBase = new Lang.Class({
         Main.overview.toggle();
     },
 
-    _setMoreIconVisible: function(visible) {
+    _setMoreIconVisible: function(visible, moreNumber) {
     },
 
     _ensureResultActors: function(results, callback) {
@@ -256,7 +258,7 @@ const SearchResultsBase = new Lang.Class({
                 results.forEach(Lang.bind(this, function(resultId) {
                     this._addItem(this._resultDisplays[resultId]);
                 }));
-                this._setMoreIconVisible(hasMoreResults && this.provider.canLaunchSearch);
+                this._setMoreIconVisible(hasMoreResults && this.provider.canLaunchSearch, 
providerResults.length - results.length);
                 this.actor.show();
                 callback();
             }));
@@ -286,6 +288,20 @@ const ListSearchResults = new Lang.Class({
                                                  x_align: St.Align.START,
                                                  y_align: St.Align.START });
 
+        this._moreResultsVisible = false;
+        this._providerDetails = new St.BoxLayout({
+                                            style_class: 'list-search-results',
+                                            /*some magic number*/
+                                            style: "width: 150px;",
+                                            vertical: true });
+
+        let providerNameLabel = new St.Label({
+                                        style_class: 'list-search-result-title',
+                                        text: provider.appInfo.get_name() });
+
+        this._providerDetails.add(providerNameLabel, {});
+
+        this._container.add(this._providerDetails, {});
         this._content = new St.BoxLayout({ style_class: 'list-search-results',
                                            vertical: true });
         this._container.add(this._content, { expand: true });
@@ -293,8 +309,16 @@ const ListSearchResults = new Lang.Class({
         this._resultDisplayBin.set_child(this._container);
     },
 
-    _setMoreIconVisible: function(visible) {
-        this.providerIcon.moreIcon.visible = visible;
+    _setMoreIconVisible: function(visible, moreNumber) {
+        /*we don;t want the plus sign anymore*/
+        //this.providerIcon.moreIcon.visible = visible;
+
+        if (!this._moreResultsVisible) {
+            this._providerDetails.add(
+                        new St.Label({ style_class: 'list-search-result-title',
+                                       text: moreNumber + ' more' }));
+            this._moreResultsVisible = true;
+        }
     },
 
     _getMaxDisplayedResults: function() {
@@ -682,7 +706,7 @@ const ProviderIcon = new Lang.Class({
     Name: 'ProviderIcon',
     Extends: St.Button,
 
-    PROVIDER_ICON_SIZE: 48,
+    PROVIDER_ICON_SIZE: 60,
 
     _init: function(provider) {
         this.provider = provider;
@@ -704,6 +728,8 @@ const ProviderIcon = new Lang.Class({
                                         x_expand: true,
                                         y_expand: true });
 
+        log(provider.appInfo.get_name());
+
         let icon = new St.Icon({ icon_size: this.PROVIDER_ICON_SIZE,
                                  gicon: provider.appInfo.get_icon() });
         this._content.add_actor(icon);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]