mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Add gnome-shell 48 support
This commit is contained in:
@@ -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", "47" ],
|
||||
"shell-version": [ "46", "47", "48" ],
|
||||
"url": "https://github.com/home-sweet-gnome/dash-to-panel",
|
||||
"gettext-domain": "dash-to-panel",
|
||||
"version": 9999,
|
||||
|
||||
@@ -180,7 +180,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
||||
this._dtpIconContainer.add_child(this._iconContainer)
|
||||
|
||||
if (appInfo.window) {
|
||||
let box = new St.BoxLayout()
|
||||
let box = Utils.createBoxLayout()
|
||||
|
||||
this._windowTitle = new St.Label({
|
||||
y_align: Clutter.ActorAlign.CENTER,
|
||||
|
||||
@@ -121,13 +121,13 @@ export const Panel = GObject.registerClass(
|
||||
Main.panel._onMenuSet.call(this, indicator)
|
||||
}
|
||||
|
||||
this._leftBox = this.panel._leftBox = new St.BoxLayout({
|
||||
this._leftBox = this.panel._leftBox = Utils.createBoxLayout({
|
||||
name: 'panelLeft',
|
||||
})
|
||||
this._centerBox = this.panel._centerBox = new St.BoxLayout({
|
||||
this._centerBox = this.panel._centerBox = Utils.createBoxLayout({
|
||||
name: 'panelCenter',
|
||||
})
|
||||
this._rightBox = this.panel._rightBox = new St.BoxLayout({
|
||||
this._rightBox = this.panel._rightBox = Utils.createBoxLayout({
|
||||
name: 'panelRight',
|
||||
})
|
||||
|
||||
|
||||
@@ -530,7 +530,7 @@ export const PanelManager = class {
|
||||
let clipContainer = new Clutter.Actor()
|
||||
|
||||
if (isStandalone) {
|
||||
panelBox = new St.BoxLayout({ name: 'panelBox' })
|
||||
panelBox = new Utils.createBoxLayout({ name: 'panelBox' })
|
||||
} else {
|
||||
panelBox = Main.layoutManager.panelBox
|
||||
Main.layoutManager._untrackActor(panelBox)
|
||||
|
||||
@@ -309,7 +309,7 @@ export const Taskbar = class extends EventEmitter {
|
||||
|
||||
let isVertical = panel.checkIfVertical()
|
||||
|
||||
this._box = new St.BoxLayout({
|
||||
this._box = Utils.createBoxLayout({
|
||||
vertical: isVertical,
|
||||
clip_to_allocation: false,
|
||||
x_align: Clutter.ActorAlign.START,
|
||||
|
||||
11
src/utils.js
11
src/utils.js
@@ -30,6 +30,7 @@ import Graphene from 'gi://Graphene'
|
||||
import Meta from 'gi://Meta'
|
||||
import Shell from 'gi://Shell'
|
||||
import St from 'gi://St'
|
||||
import * as Config from 'resource:///org/gnome/shell/misc/config.js'
|
||||
import * as Util from 'resource:///org/gnome/shell/misc/util.js'
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js'
|
||||
import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js'
|
||||
@@ -180,6 +181,16 @@ export const TimeoutsHandler = class extends BasicHandler {
|
||||
}
|
||||
}
|
||||
|
||||
export function createBoxLayout(options) {
|
||||
if (options && Config.PACKAGE_VERSION >= '48') {
|
||||
// https://mutter.gnome.org/clutter/enum.Orientation.html
|
||||
options.orientation = options.vertical ? 1 : 0
|
||||
delete options.vertical
|
||||
}
|
||||
|
||||
return new St.BoxLayout(options)
|
||||
}
|
||||
|
||||
// This is wrapper to maintain compatibility with GNOME-Shell 3.30+ as well as
|
||||
// previous versions.
|
||||
export const DisplayWrapper = {
|
||||
|
||||
@@ -92,7 +92,7 @@ export const PreviewMenu = GObject.registerClass(
|
||||
y_align:
|
||||
Clutter.ActorAlign[geom.position != St.Side.BOTTOM ? 'START' : 'END'],
|
||||
})
|
||||
this._box = new St.BoxLayout({ vertical: this.isVertical })
|
||||
this._box = Utils.createBoxLayout({ vertical: this.isVertical })
|
||||
this._scrollView = new St.ScrollView({
|
||||
name: 'dashtopanelPreviewScrollview',
|
||||
hscrollbar_policy: St.PolicyType.NEVER,
|
||||
|
||||
Reference in New Issue
Block a user