mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-15 00:34:05 +09:00
Merge branch 'master' of https://github.com/Hirnmoder/dash-to-panel into panel-border
This commit is contained in:
10
appIcons.js
10
appIcons.js
@@ -1049,13 +1049,13 @@ export const TaskbarAppIcon = GObject.registerClass({
|
||||
|
||||
_getRunningIndicatorColor(isFocused) {
|
||||
let color;
|
||||
const fallbackColor = new Clutter.Color({ red: 82, green: 148, blue: 226, alpha: 255 });
|
||||
const fallbackColor = new Utils.ColorUtils.Color({ red: 82, green: 148, blue: 226, alpha: 255 });
|
||||
|
||||
if (SETTINGS.get_boolean('dot-color-dominant')) {
|
||||
let dce = new Utils.DominantColorExtractor(this.app);
|
||||
let palette = dce._getColorPalette();
|
||||
if (palette) {
|
||||
color = Clutter.color_from_string(palette.original)[1];
|
||||
color = Utils.ColorUtils.color_from_string(palette.original)[1];
|
||||
} else { // unable to determine color, fall back to theme
|
||||
let themeNode = this._dot.get_theme_node();
|
||||
color = themeNode.get_background_color();
|
||||
@@ -1069,7 +1069,7 @@ export const TaskbarAppIcon = GObject.registerClass({
|
||||
if(!isFocused && SETTINGS.get_boolean('dot-color-unfocused-different'))
|
||||
dotColorSettingPrefix = 'dot-color-unfocused-';
|
||||
|
||||
color = Clutter.color_from_string(SETTINGS.get_string(dotColorSettingPrefix + (this._getRunningIndicatorCount() || 1) ))[1];
|
||||
color = Utils.ColorUtils.color_from_string(SETTINGS.get_string(dotColorSettingPrefix + (this._getRunningIndicatorCount() || 1) ))[1];
|
||||
} else {
|
||||
// Re-use the style - background color, and border width and color -
|
||||
// of the default dot
|
||||
@@ -1132,8 +1132,8 @@ export const TaskbarAppIcon = GObject.registerClass({
|
||||
} else {
|
||||
let blackenedLength = (1 / 48) * areaSize; // need to scale with the SVG for the stacked highlight
|
||||
let darkenedLength = isFocused ? (2 / 48) * areaSize : (10 / 48) * areaSize;
|
||||
let blackenedColor = new Clutter.Color({ red: bodyColor.red * .3, green: bodyColor.green * .3, blue: bodyColor.blue * .3, alpha: bodyColor.alpha });
|
||||
let darkenedColor = new Clutter.Color({ red: bodyColor.red * .7, green: bodyColor.green * .7, blue: bodyColor.blue * .7, alpha: bodyColor.alpha });
|
||||
let blackenedColor = new Utils.ColorUtils.Color({ red: bodyColor.red * .3, green: bodyColor.green * .3, blue: bodyColor.blue * .3, alpha: bodyColor.alpha });
|
||||
let darkenedColor = new Utils.ColorUtils.Color({ red: bodyColor.red * .7, green: bodyColor.green * .7, blue: bodyColor.blue * .7, alpha: bodyColor.alpha });
|
||||
let solidDarkLength = areaSize - darkenedLength;
|
||||
let solidLength = solidDarkLength - blackenedLength;
|
||||
|
||||
|
||||
@@ -57,15 +57,20 @@
|
||||
|
||||
import GLib from 'gi://GLib';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
|
||||
import {EXTENSION_UUID} from './extension.js';
|
||||
|
||||
import * as ExtensionUtils from 'resource:///org/gnome/shell/misc/extensionUtils.js';
|
||||
import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
|
||||
const IDENTIFIER_UUID = "130cbc66-235c-4bd6-8571-98d2d8bba5e2";
|
||||
|
||||
export const DesktopIconsUsableAreaClass = class {
|
||||
export class DesktopIconsUsableAreaClass {
|
||||
_checkIfExtensionIsEnabled(extension) {
|
||||
return (extension?.state === ExtensionUtils.ExtensionState.ENABLED) ||
|
||||
(extension?.state === ExtensionUtils.ExtensionState.ACTIVE);
|
||||
}
|
||||
|
||||
constructor() {
|
||||
const Me = Extension.lookupByURL(import.meta.url);
|
||||
this._UUID = Me.uuid;
|
||||
this._extensionManager = Main.extensionManager;
|
||||
this._timedMarginsID = 0;
|
||||
this._margins = {};
|
||||
@@ -74,7 +79,7 @@ export const DesktopIconsUsableAreaClass = class {
|
||||
return;
|
||||
|
||||
// If an extension is being enabled and lacks the DesktopIconsUsableArea object, we can avoid launching a refresh
|
||||
if (extension.state === ExtensionUtils.ExtensionState.ENABLED) {
|
||||
if (this._checkIfExtensionIsEnabled(extension)) {
|
||||
this._sendMarginsToExtension(extension);
|
||||
return;
|
||||
}
|
||||
@@ -150,11 +155,11 @@ export const DesktopIconsUsableAreaClass = class {
|
||||
_sendMarginsToExtension(extension) {
|
||||
// check that the extension is an extension that has the logic to accept
|
||||
// working margins
|
||||
if (extension?.state !== ExtensionUtils.ExtensionState.ENABLED)
|
||||
if (!this._checkIfExtensionIsEnabled(extension))
|
||||
return;
|
||||
|
||||
const usableArea = extension?.stateObj?.DesktopIconsUsableArea;
|
||||
if (usableArea?.uuid === IDENTIFIER_UUID)
|
||||
usableArea.setMarginsForExtension(EXTENSION_UUID, this._margins);
|
||||
if (usableArea?.uuid === IDENTIFIER_UUID)
|
||||
usableArea.setMarginsForExtension(this._UUID, this._margins);
|
||||
}
|
||||
}
|
||||
|
||||
28
extension.js
28
extension.js
@@ -25,7 +25,6 @@ import {EventEmitter} from 'resource:///org/gnome/shell/misc/signals.js';
|
||||
import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
|
||||
import * as PanelManager from './panelManager.js';
|
||||
import * as Utils from './utils.js';
|
||||
import * as AppIcons from './appIcons.js';
|
||||
|
||||
|
||||
@@ -34,7 +33,6 @@ const UBUNTU_DOCK_UUID = 'ubuntu-dock@ubuntu.com';
|
||||
let panelManager;
|
||||
let extensionChangedHandler;
|
||||
let startupCompleteHandler;
|
||||
let disabledUbuntuDock;
|
||||
let extensionSystem = Main.extensionManager;
|
||||
|
||||
export let DTP_EXTENSION = null;
|
||||
@@ -82,12 +80,9 @@ export default class DashToPanelExtension extends Extension {
|
||||
|
||||
if (!reset) {
|
||||
extensionSystem.disconnect(extensionChangedHandler);
|
||||
delete global.dashToPanel;
|
||||
extensionSystem.enableExtension(UBUNTU_DOCK_UUID);
|
||||
|
||||
// Re-enable Ubuntu Dock if it was disabled by dash to panel
|
||||
if (disabledUbuntuDock) {
|
||||
(extensionSystem._callExtensionEnable || extensionSystem.enableExtension).call(extensionSystem, UBUNTU_DOCK_UUID);
|
||||
}
|
||||
delete global.dashToPanel;
|
||||
|
||||
AppIcons.resetRecentlyClickedApp();
|
||||
}
|
||||
@@ -102,24 +97,7 @@ export default class DashToPanelExtension extends Extension {
|
||||
}
|
||||
|
||||
function _enable(extension) {
|
||||
let ubuntuDock = extensionSystem.lookup(UBUNTU_DOCK_UUID);
|
||||
|
||||
if (ubuntuDock && ubuntuDock.stateObj && ubuntuDock.state == 1) { //ExtensionState.ACTIVE
|
||||
// Disable Ubuntu Dock
|
||||
let extensionOrder = extensionSystem._extensionOrder;
|
||||
|
||||
ubuntuDock.stateObj.disable();
|
||||
extensionSystem._unloadExtensionStylesheet(ubuntuDock);
|
||||
ubuntuDock.state = 2; //ExtensionState.INACTIVE
|
||||
extensionOrder.splice(extensionOrder.indexOf(UBUNTU_DOCK_UUID), 1);
|
||||
|
||||
disabledUbuntuDock = true;
|
||||
|
||||
//reset to prevent conflicts with the ubuntu-dock
|
||||
if (panelManager) {
|
||||
extension.disable(true);
|
||||
}
|
||||
}
|
||||
extensionSystem.disableExtension(UBUNTU_DOCK_UUID);
|
||||
|
||||
if (panelManager) return; //already initialized
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"uuid": "dash-to-panel@jderose9.github.com",
|
||||
"name": "Dash to Panel",
|
||||
"description": "An icon taskbar for the Gnome Shell. This extension moves the dash into the gnome main panel so that the application launchers and system tray are combined into a single panel, similar to that found in KDE Plasma and Windows 7+. A separate dock is no longer needed for easy access to running and favorited applications.\n\nFor a more traditional experience, you may also want to use Tweak Tool to enable Windows > Titlebar Buttons > Minimize & Maximize.\n\nFor the best support, please report any issues on Github. Dash-to-panel is developed and maintained by @jderose9 and @charlesg99.",
|
||||
"shell-version": [ "46" ],
|
||||
"shell-version": [ "46", "47" ],
|
||||
"url": "https://github.com/home-sweet-gnome/dash-to-panel",
|
||||
"gettext-domain": "dash-to-panel",
|
||||
"version": 9999,
|
||||
|
||||
2
po/pl.po
2
po/pl.po
@@ -323,7 +323,7 @@ msgstr "Zablokuj pasek zadań"
|
||||
|
||||
#: appIcons.js:1855
|
||||
msgid "Dash to Panel Settings"
|
||||
msgstr "Ustawienia Dash to Panel"
|
||||
msgstr "Ustawienia panelu"
|
||||
|
||||
#: appIcons.js:1860
|
||||
msgid "Restore Windows"
|
||||
|
||||
@@ -405,13 +405,13 @@ export const ProgressIndicator = class {
|
||||
if (hasColor)
|
||||
this._progressbar_background = color
|
||||
else
|
||||
this._progressbar_background = new Clutter.Color({red: 204, green: 204, blue: 204, alpha: 255});
|
||||
this._progressbar_background = new Utils.ColorUtils.Color({red: 204, green: 204, blue: 204, alpha: 255});
|
||||
|
||||
[hasColor, color] = node.lookup_color('-progress-bar-border', false);
|
||||
if (hasColor)
|
||||
this._progressbar_border = color;
|
||||
else
|
||||
this._progressbar_border = new Clutter.Color({red: 230, green: 230, blue: 230, alpha: 255});
|
||||
this._progressbar_border = new Utils.ColorUtils.Color({red: 230, green: 230, blue: 230, alpha: 255});
|
||||
|
||||
this._updateProgressOverlay();
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
*/
|
||||
|
||||
#dashtopanelTaskbar .dash-item-container > StWidget,
|
||||
.dashtopanelMainPanel .show-apps {
|
||||
.dashtopanelMainPanel .dash-item-container .show-apps {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#dashtopanelScrollview .overview-tile,
|
||||
@@ -39,13 +39,19 @@
|
||||
}
|
||||
|
||||
#dashtopanelScrollview .overview-tile:hover .dtp-container,
|
||||
#dashtopanelScrollview .overview-tile:focus .dtp-container {
|
||||
background-color: rgba(238, 238, 236, 0.1);
|
||||
#dashtopanelScrollview .overview-tile:focus .dtp-container,
|
||||
.dashtopanelMainPanel .dash-item-container .show-apps:hover {
|
||||
background-color: rgba(238, 238, 238, 0.1);
|
||||
}
|
||||
|
||||
.dashtopanelMainPanel .dash-item-container .show-apps .overview-icon {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#dashtopanelTaskbar .dash-item-container .overview-tile:hover,
|
||||
#dashtopanelTaskbar .dash-item-container .overview-tile .dtp-container .overview-icon,
|
||||
#dashtopanelScrollview .overview-tile:hover .dtp-container.animate-appicon-hover {
|
||||
#dashtopanelScrollview .overview-tile:hover .dtp-container.animate-appicon-hover,
|
||||
.dashtopanelMainPanel .dash-item-container .show-apps:hover .overview-icon {
|
||||
background: none;
|
||||
}
|
||||
|
||||
@@ -58,7 +64,7 @@
|
||||
}
|
||||
|
||||
#dashtopanelTaskbar .scrollview-fade {
|
||||
background-gradient-end: rgba(0, 0, 0, 0);
|
||||
background-gradient-end: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.dashtopanelSecondaryMenu {
|
||||
@@ -66,13 +72,13 @@
|
||||
}
|
||||
|
||||
.dashtopanelMainPanel.vertical .panel-button {
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dashtopanelMainPanel.vertical .panel-button.vertical *,
|
||||
.dashtopanelMainPanel.vertical .panel-button.clock-display * {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dashtopanelMainPanel.vertical .panel-button > *,
|
||||
@@ -80,7 +86,7 @@
|
||||
.dashtopanelMainPanel.vertical .panel-button.vertical .system-status-icon,
|
||||
.dashtopanelMainPanel.vertical .panel-button.clock-display > *,
|
||||
.dashtopanelMainPanel.vertical .panel-button.clock-display .clock {
|
||||
padding: 8px 0;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.dashtopanelMainPanel.vertical .panel-button.clock-display {
|
||||
@@ -109,11 +115,11 @@
|
||||
}
|
||||
|
||||
.popup-menu.panel-menu {
|
||||
margin-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#panel #panelLeft, #panel #panelCenter {
|
||||
spacing: 0px;
|
||||
spacing: 0px;
|
||||
}
|
||||
|
||||
.showdesktop-button-dark-hovered {
|
||||
@@ -135,16 +141,15 @@
|
||||
}
|
||||
|
||||
#dashtopanelScrollview .notification-badge {
|
||||
background-color: rgba(255,0,0,0.8);
|
||||
background-color: rgba(255,0,0,0.8);
|
||||
}
|
||||
|
||||
#dashtopanelScrollview .progress-bar {
|
||||
/* Customization of the progress bar style, e.g.:
|
||||
-progress-bar-background: rgba(0.8, 0.8, 0.8, 1);
|
||||
-progress-bar-border: rgba(0.9, 0.9, 0.9, 1);
|
||||
*/
|
||||
/* Customization of the progress bar style, e.g.:
|
||||
-progress-bar-background: rgba(0.8, 0.8, 0.8, 1);
|
||||
-progress-bar-border: rgba(0.9, 0.9, 0.9, 1); */
|
||||
}
|
||||
|
||||
.symbolic-icon-style {
|
||||
-st-icon-style: symbolic;
|
||||
-st-icon-style: symbolic;
|
||||
}
|
||||
|
||||
8
utils.js
8
utils.js
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Cogl from 'gi://Cogl';
|
||||
import GdkPixbuf from 'gi://GdkPixbuf';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
@@ -317,7 +318,7 @@ export const removeKeybinding = function(key) {
|
||||
};
|
||||
|
||||
export const getrgbColor = function(color) {
|
||||
color = typeof color === 'string' ? Clutter.color_from_string(color)[1] : color;
|
||||
color = typeof color === 'string' ? ColorUtils.color_from_string(color)[1] : color;
|
||||
|
||||
return { red: color.red, green: color.green, blue: color.blue };
|
||||
};
|
||||
@@ -561,7 +562,12 @@ export const ensureActorVisibleInScrollView = function(scrollView, actor, fadeSi
|
||||
/**
|
||||
* ColorUtils is adapted from https://github.com/micheleg/dash-to-dock
|
||||
*/
|
||||
let colorNs = Clutter.Color ? Clutter : Cogl
|
||||
|
||||
export const ColorUtils = {
|
||||
color_from_string: colorNs.color_from_string,
|
||||
Color: colorNs.Color,
|
||||
|
||||
colorLuminance(r, g, b, dlum) {
|
||||
// Darken or brighten color by a fraction dlum
|
||||
// Each rgb value is modified by the same fraction.
|
||||
|
||||
Reference in New Issue
Block a user