Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/data/Makefile.am b/data/Makefile.am
- index 8c04198..d8cb906 100644
- --- a/data/Makefile.am
- +++ b/data/Makefile.am
- @@ -27,6 +27,7 @@ dist_theme_DATA = \
- theme/corner-ripple.png \
- theme/dash-placeholder.svg \
- theme/dialog-error.svg \
- + theme/filter-selected.svg \
- theme/gnome-shell.css \
- theme/mosaic-view-active.svg \
- theme/mosaic-view.svg \
- diff --git a/data/gs-applications.menu b/data/gs-applications.menu
- index 1d0bfdc..494902b 100644
- --- a/data/gs-applications.menu
- +++ b/data/gs-applications.menu
- @@ -1,13 +1,28 @@
- <Menu>
- <DefaultLayout>
- - <Menuname>Apps</Menuname>
- - <Menuname>Games</Menuname>
- - <Menuname>Tools</Menuname>
- - </DefaultLayout>
- + <Menuname>Accessories</Menuname>
- + <Menuname>Games</Menuname>
- + <Menuname>Graphics</Menuname>
- + <Menuname>Internet</Menuname>
- + <Menuname>Multimedia</Menuname>
- + <Menuname>Office</Menuname>
- + <Menuname>Other</Menuname>
- + </DefaultLayout>
- <Name>Applications</Name>
- <AppDir>/usr/local/share/applications</AppDir>
- <DefaultAppDirs/>
- <Menu>
- + <Name>Accessories</Name>
- + <Include>
- + <And>
- + <Category>Utility</Category>
- + <Not>
- + <Category>System</Category>
- + </Not>
- + </And>
- + </Include>
- + </Menu>
- + <Menu>
- <Name>Games</Name>
- <Include>
- <And>
- @@ -16,20 +31,44 @@
- </Include>
- </Menu>
- <Menu>
- - <Name>Tools</Name>
- + <Name>Graphics</Name>
- <Include>
- - <Category>Development</Category>
- <And>
- - <Category>System</Category>
- - <Not>
- - <Category>Settings</Category>
- - </Not>
- + <Category>Graphics</Category>
- + </And>
- + </Include>
- + </Menu>
- +
- + <Menu>
- + <Name>Internet</Name>
- + <Include>
- + <And>
- + <Category>Network</Category>
- + <Not><Category>Settings</Category></Not>
- + </And>
- + </Include>
- + </Menu>
- +
- + <Menu>
- + <Name>Multimedia</Name>
- + <Include>
- + <And>
- + <Category>AudioVideo</Category>
- + <Not><Category>Settings</Category></Not>
- + </And>
- + </Include>
- + </Menu>
- +
- + <Menu>
- + <Name>Office</Name>
- + <Include>
- + <And>
- + <Category>Office</Category>
- </And>
- - <Category>Utility</Category>
- </Include>
- </Menu>
- <Menu>
- - <Name>Apps</Name>
- + <Name>Other</Name>
- <OnlyUnallocated/>
- <Include>
- <And>
- diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
- index 3afd536..10f1dcd 100644
- --- a/data/theme/gnome-shell.css
- +++ b/data/theme/gnome-shell.css
- @@ -544,7 +544,7 @@ StTooltip {
- /* Apps */
- .overview-pane {
- - width: 440px;
- + width: 640px;
- }
- .icon-grid {
- @@ -554,17 +554,25 @@ StTooltip {
- .all-app {
- padding: 10px;
- + padding-top: 30px; /**/
- + padding-bottom: 10px; /**/
- }
- -.app-section-divider-container {
- - padding-top: 10px;
- - padding-bottom: 10px;
- +.app-filters-container {
- + width: 201px;
- }
- -.app-section-divider {
- - height: 2px;
- - background-image: url("separator-white.png");
- -}
- +.app-filter {
- + font-size: 14px;
- + font-weight: bold;
- + height: 40px;
- + color: #aaa;
- + }
- +.app-filter:selected {
- + color: #ffffff;
- + background-image: url("filter-selected.svg");
- + background-position: 190px 0px;
- + }
- #Dash > .app-well-app {
- padding: 6px 12px;
- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
- index 09c7c88..a3e6343 100644
- --- a/js/ui/appDisplay.js
- +++ b/js/ui/appDisplay.js
- @@ -29,10 +29,18 @@ function AlphabeticalView() {
- AlphabeticalView.prototype = {
- _init: function() {
- - this.actor = new St.BoxLayout({ vertical: true });
- this._grid = new IconGrid.IconGrid();
- this._appSystem = Shell.AppSystem.get_default();
- - this.actor.add(this._grid.actor, { y_align: St.Align.START, expand: tr
- +
- + let box = new St.BoxLayout({ vertical: true });
- + box.add(this._grid.actor, { y_align: St.Align.START, expand: true });
- +
- + this.actor = new St.ScrollView({ x_fill: true,
- + y_fill: false,
- + y_align: St.Align.START,
- + vshadows: true });
- + this.actor.add_actor(box);
- + this.actor.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
- },
- _removeAll: function() {
- @@ -79,54 +87,82 @@ function ViewByCategories() {
- ViewByCategories.prototype = {
- _init: function() {
- this._appSystem = Shell.AppSystem.get_default();
- - this.actor = new St.BoxLayout({ vertical: true });
- + let container = new St.BoxLayout();
- + this.actor = new St.Bin({ child: container, x_fill: true, y_fill: true
- this.actor._delegate = this;
- +
- + this._view = new AlphabeticalView();
- + this._view.connect('launching', Lang.bind(this, function() {
- + this.emit('launching');
- + }));
- + this._view.connect('drag-begin', Lang.bind(this, function() {
- + this.emit('drag-begin');
- + }));
- +
- + this._filters = new St.BoxLayout({ style_class: 'app-filters-container
- + container.add(this._view.actor, { expand: true, x_fill: true, y_fill:
- + container.add(this._filters, { expand: false, y_fill: false, y_align:
- +
- this._sections = [];
- },
- - _updateSections: function(apps) {
- + _selectCategory: function(num) {
- + let apps;
- + if (num != -1) {
- + this._allFilter.remove_style_pseudo_class('selected');
- + apps = this._sections[num].apps;
- + } else {
- + this._allFilter.add_style_pseudo_class('selected');
- + apps = this._apps;
- + }
- + this._view.refresh(apps);
- +
- + for (let i = 0; i < this._sections.length; i++) {
- + if (i == num)
- + this._sections[i].menuActor.add_style_pseudo_class('selected')
- + else
- + this._sections[i].menuActor.remove_style_pseudo_class('selecte
- + }
- + },
- +
- + _addFilter: function(name, num) {
- + let button = new St.Button({ label: name,
- + style_class: 'app-filter',
- + x_align: St.Align.START });
- + this._filters.add(button, { expand: true, x_fill: true, y_fill: false
- + button.connect('clicked', Lang.bind(this, function() {
- + this._selectCategory(num);
- + }));
- +
- + return button;
- + },
- +
- + _removeAll: function() {
- + this._sections = [];
- + this._filters.destroy_children();
- + },
- +
- + refresh: function(apps) {
- this._removeAll();
- let sections = this._appSystem.get_sections();
- if (!sections)
- return;
- - for (let i = 0; i < sections.length; i++) {
- - if (i) {
- - let actor = new St.Bin({ style_class: 'app-section-divider' })
- - let divider = new St.Bin({ style_class: 'app-section-divider-c
- - child: actor,
- - x_fill: true });
- + this._apps = apps;
- + this._allFilter = this._addFilter(_("All"), -1);
- - this.actor.add(divider, { y_fill: false, expand: true });
- - }
- + for (let i = 0; i < sections.length; i++) {
- let _apps = apps.filter(function(app) {
- return app.get_section() == sections[i];
- });
- - this._sections[i] = { view: new AlphabeticalView(),
- - apps: _apps,
- - name: sections[i] };
- - this._sections[i].view.connect('launching', Lang.bind(this, functi
- - this.emit('launching');
- - }));
- - this._sections[i].view.connect('drag-begin', Lang.bind(this, funct
- - this.emit('drag-begin');
- - }));
- - this.actor.add(this._sections[i].view.actor, { y_align: St.Align.S
- - }
- - },
- -
- - _removeAll: function() {
- - this.actor.destroy_children();
- - this._sections.forEach(function (section) { section.view.disconnectAll
- - this._sections = [];
- - },
- + let name = this._addFilter(sections[i], i);
- + this._sections[i] = { apps: _apps,
- + menuActor: name,
- + name: sections[i] };
- - refresh: function(apps) {
- - this._updateSections(apps);
- - for (let i = 0; i < this._sections.length; i++) {
- - this._sections[i].view.refresh(this._sections[i].apps);
- }
- + this._selectCategory(-1);
- }
- };
- @@ -146,18 +182,11 @@ AllAppDisplay.prototype = {
- Main.queueDeferredWork(this._workId);
- }));
- - this._scrollView = new St.ScrollView({ x_fill: true,
- - y_fill: false,
- - vshadows: true });
- - this.actor = new St.Bin({ style_class: 'all-app',
- - y_align: St.Align.START,
- - child: this._scrollView });
- -
- this._appView = new ViewByCategories();
- - this._scrollView.add_actor(this._appView.actor);
- -
- - this._scrollView.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOM
- + this.actor = this._appView.actor;
- + this.actor.style_class = 'all-app';
- +
- this._workId = Main.initializeDeferredWork(this.actor, Lang.bind(this,
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement