style and naming cleanup for #15

This commit is contained in:
jderose9
2017-01-10 18:35:10 -05:00
parent 4049d7719b
commit 65f0a0b3ed
10 changed files with 41 additions and 38 deletions

View File

@@ -93,7 +93,7 @@ function getSettings(schema) {
// simplify global signals and function injections handling
// abstract class
const BasicHandler = new Lang.Class({
Name: 'Taskbar.BasicHandler',
Name: 'DashToPanel.BasicHandler',
_init: function(){
this._storage = new Object();
@@ -149,7 +149,7 @@ const BasicHandler = new Lang.Class({
// Manage global signals
const GlobalSignalsHandler = new Lang.Class({
Name: 'Taskbar.GlobalSignalsHandler',
Name: 'DashToPanel.GlobalSignalsHandler',
Extends: BasicHandler,
_create: function(item) {
@@ -172,7 +172,7 @@ const GlobalSignalsHandler = new Lang.Class({
* and restored
*/
const InjectionsHandler = new Lang.Class({
Name: 'Taskbar.InjectionsHandler',
Name: 'DashToPanel.InjectionsHandler',
Extends: BasicHandler,
_create: function(item) {

View File

@@ -32,9 +32,9 @@ function init() {
function enable() {
settings = Convenience.getSettings('org.gnome.shell.extensions.dash-to-panel');
panel = new Panel.taskbarPanel(settings);
panel = new Panel.dtpPanel(settings);
panel.enable();
overview = new Overview.taskbarOverview(settings);
overview = new Overview.dtpOverview(settings);
overview.enable(panel.taskbar);
}

View File

@@ -26,8 +26,8 @@ const Lang = imports.lang;
const Main = imports.ui.main;
const Shell = imports.gi.Shell;
const taskbarOverview = new Lang.Class({
Name: 'TaskBar.Overview',
const dtpOverview = new Lang.Class({
Name: 'DashToPanel.Overview',
_init: function(settings) {
this._dtpSettings = settings;

View File

@@ -30,18 +30,18 @@
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Clutter = imports.gi.Clutter;
const Convenience = Me.imports.convenience;
const TaskBar = Me.imports.taskbar;
const Taskbar = Me.imports.taskbar;
const PanelStyle = Me.imports.panelStyle;
const Lang = imports.lang;
const Main = imports.ui.main;
const St = imports.gi.St;
const taskbarPanel = new Lang.Class({
Name: 'TaskBar.Panel',
const dtpPanel = new Lang.Class({
Name: 'DashToPanel.Panel',
_init: function(settings) {
this._dtpSettings = settings;
this.panelStyle = new PanelStyle.taskbarPanelStyle(settings);
this.panelStyle = new PanelStyle.dtpPanelStyle(settings);
},
enable : function() {
@@ -94,7 +94,7 @@ const taskbarPanel = new Lang.Class({
this._panelConnectId = this.panel.actor.connect('allocate', Lang.bind(this, function(actor,box,flags){this._allocate(actor,box,flags);}));
this.container.remove_child(this.appMenu.container);
this.taskbar = new TaskBar.taskbar(this._dtpSettings);
this.taskbar = new Taskbar.taskbar(this._dtpSettings);
Main.overview.dashIconSize = this.taskbar.iconSize;
this.container.insert_child_at_index( this.taskbar.actor, 2 );
@@ -105,6 +105,7 @@ const taskbarPanel = new Lang.Class({
this._setActivitiesButtonVisible(this._dtpSettings.get_boolean('show-activities-button'));
this._setClockLocation(this._dtpSettings.get_string('location-clock'));
this.panel.actor.add_style_class_name('dashtopanelMainPanel');
// Since Gnome 3.8 dragging an app without having opened the overview before cause the attemp to
//animate a null target since some variables are not initialized when the viewSelector is created
@@ -171,6 +172,8 @@ const taskbarPanel = new Lang.Class({
// reset stored icon size to the default dash
Main.overview.dashIconSize = Main.overview._controls.dash.iconSize;
this.panel.actor.remove_style_class_name('dashtopanelMainPanel');
// remove this.panel styling
if(this._HeightNotifyListener !== null) {
this.panelBox.disconnect(this._HeightNotifyListener);

View File

@@ -29,10 +29,10 @@ const Mainloop = imports.mainloop;
const St = imports.gi.St;
const Shell = imports.gi.Shell;
const TaskBar = Me.imports.taskbar;
const Taskbar = Me.imports.taskbar;
const taskbarPanelStyle = new Lang.Class({
Name: 'TaskBar.PanelStyle',
const dtpPanelStyle = new Lang.Class({
Name: 'DashToPanel.PanelStyle',
_init: function(settings) {
this._dtpSettings = settings;

View File

@@ -42,7 +42,7 @@ const DEFAULT_MARGIN_SIZES = [ 32, 24, 16, 12, 8, 4, 0 ];
const DEFAULT_PADDING_SIZES = [ 32, 24, 16, 12, 8, 4, 0, -1 ];
const Settings = new Lang.Class({
Name: 'TaskBar.Settings',
Name: 'DashToPanel.Settings',
_init: function() {
this._settings = Convenience.getSettings('org.gnome.shell.extensions.dash-to-panel');

View File

@@ -37,7 +37,7 @@ const Taskbar = Me.imports.taskbar;
*/
const taskbarSecondaryMenu = new Lang.Class({
Name: 'taskbarSecondaryMenu',
Name: 'DashToPanel.SecondaryMenu',
Extends: AppDisplay.AppIconMenu,
_init: function(source, settings) {

View File

@@ -21,47 +21,47 @@
* Some code was also adapted from the upstream Gnome Shell source code.
*/
#taskbarScrollview .dash-item-container > StWidget {
#dashtopanelScrollview .dash-item-container > StWidget {
padding: 0;
margin: 0 8px;
}
#taskbarScrollview .app-well-app .overview-icon {
#dashtopanelScrollview .app-well-app .overview-icon {
border-radius: 0;
padding: 8px;
border: none;
}
#taskbarScrollview .app-well-app-running-dot {
#dashtopanelScrollview .app-well-app-running-dot {
margin-bottom: 0;
}
#thumbnailPreviewScrollview,
#taskbarScrollview {
#dashtopanelThumbnailScrollview,
#dashtopanelScrollview {
-st-hfade-offset: 48px;
}
.taskbarSecondaryMenu {
.dashtopanelSecondaryMenu {
max-width: 400px;
}
#thumbnailPreviewList {
#dashtopanelThumbnailList {
spacing: 0em;
padding: 0 1em;
}
#thumbnailPreviewList .popup-menu-item {
#dashtopanelThumbnailList .popup-menu-item {
padding: 1em;
border-radius: 5px;
spacing: 0;
}
#thumbnailPreviewList .window-box {
#dashtopanelThumbnailList .window-box {
padding: 0;
spacing: 0;
}
#thumbnailPreviewList .preview-window-title {
#dashtopanelThumbnailList .preview-window-title {
padding-top: 1em;
}

View File

@@ -138,7 +138,7 @@ function extendDashItemContainer(dashItemContainer) {
*/
const taskbarActor = new Lang.Class({
Name: 'taskbarActor',
Name: 'DashToPanel.TaskbarActor',
_init: function() {
this._rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL;
@@ -147,7 +147,7 @@ const taskbarActor = new Lang.Class({
let layout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.HORIZONTAL });
this.actor = new Shell.GenericContainer({ name: 'taskbar',
this.actor = new Shell.GenericContainer({ name: 'dashtopanelTaskbar',
layout_manager: layout,
clip_to_allocation: true });
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
@@ -220,7 +220,7 @@ const taskbarActor = new Lang.Class({
const baseIconSizes = [ 16, 22, 24, 32, 48, 64, 96, 128 ];
const taskbar = new Lang.Class({
Name: 'taskbar.taskbar',
Name: 'DashToPanel.Taskbar',
_init : function(settings) {
this._dtpSettings = settings;
@@ -242,7 +242,7 @@ const taskbar = new Lang.Class({
this._containerObject = new taskbarActor();
this._container = this._containerObject.actor;
this._scrollView = new St.ScrollView({ name: 'taskbarScrollview',
this._scrollView = new St.ScrollView({ name: 'dashtopanelScrollview',
hscrollbar_policy: Gtk.PolicyType.NEVER,
vscrollbar_policy: Gtk.PolicyType.NEVER,
enable_mouse_scrolling: true });
@@ -1162,7 +1162,7 @@ Signals.addSignalMethods(taskbar.prototype);
let tracker = Shell.WindowTracker.get_default();
const taskbarAppIcon = new Lang.Class({
Name: 'taskbar.AppIcon',
Name: 'DashToPanel.TaskbarAppIcon',
Extends: AppDisplay.AppIcon,
_init: function(settings, app, iconParams, onActivateOverride) {
@@ -1322,7 +1322,7 @@ const taskbarAppIcon = new Lang.Class({
this._windowPreview.close();
this.actor.set_hover(true);
this._menu.actor.add_style_class_name('taskbarSecondaryMenu');
this._menu.actor.add_style_class_name('dashtopanelSecondaryMenu');
this._menu.popup();
this._menuManager.ignoreRelease();
this.emit('sync-tooltip');

View File

@@ -41,7 +41,7 @@ let DEFAULT_THUMBNAIL_WIDTH = 350;
let DEFAULT_THUMBNAIL_HEIGHT = 200;
const thumbnailPreviewMenu = new Lang.Class({
Name: 'thumbnailPreviewMenu',
Name: 'DashToPanel.ThumbnailPreviewMenu',
Extends: PopupMenu.PopupMenu,
_init: function(source, settings) {
@@ -183,7 +183,7 @@ const thumbnailPreviewMenu = new Lang.Class({
});
const thumbnailPreview = new Lang.Class({
Name: 'thumbnailPreview',
Name: 'DashToPanel.ThumbnailPreview',
Extends: PopupMenu.PopupBaseMenuItem,
_init: function(window) {
@@ -413,7 +413,7 @@ const thumbnailPreview = new Lang.Class({
});
const thumbnailPreviewList = new Lang.Class({
Name: 'thumbnailPreviewList',
Name: 'DashToPanel.ThumbnailPreviewList',
Extends: PopupMenu.PopupMenuSection,
_init: function(app, settings) {
@@ -423,7 +423,7 @@ const thumbnailPreviewList = new Lang.Class({
this._ensurePreviewVisibilityTimeoutId = 0;
this.actor = new St.ScrollView({ name: 'thumbnailPreviewScrollview',
this.actor = new St.ScrollView({ name: 'dashtopanelThumbnailScrollview',
hscrollbar_policy: Gtk.PolicyType.NEVER,
vscrollbar_policy: Gtk.PolicyType.NEVER,
enable_mouse_scrolling: true });
@@ -431,7 +431,7 @@ const thumbnailPreviewList = new Lang.Class({
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent ));
this.box.set_vertical(false);
this.box.set_name("thumbnailPreviewList");
this.box.set_name("dashtopanelThumbnailList");
this.actor.add_actor(this.box);
this.actor._delegate = this;