Only apply border radius to panel if not full length

gh-1819
This commit is contained in:
Charles Gagnon
2025-02-15 12:24:24 -05:00
parent 37192b5d6e
commit 2b43ccee86
2 changed files with 22 additions and 10 deletions

View File

@@ -220,6 +220,7 @@ export const Panel = GObject.registerClass(
this.geom = this.getGeometry()
this._setPanelBoxStyle()
this._maybeSetDockCss()
this._setPanelPosition()
if (!this.isStandalone) {
@@ -681,6 +682,7 @@ export const Panel = GObject.registerClass(
_resetGeometry() {
this._setPanelBoxStyle()
this.geom = this.getGeometry()
this._maybeSetDockCss()
this._setPanelPosition()
this.taskbar.resetAppIcons(true)
this.dynamicTransparency.updateExternalStyle()
@@ -711,6 +713,7 @@ export const Panel = GObject.registerClass(
)
let anchor = PanelSettings.getPanelAnchor(SETTINGS, this.monitor.index)
let dynamic = panelLength == -1 ? Pos.anchorToPosition[anchor] : 0
let dockMode = false
let length = (dynamic ? 100 : panelLength) / 100
let anchorPlaceOnMonitor = 0
let gsTopPanelOffset = 0
@@ -743,6 +746,7 @@ export const Panel = GObject.registerClass(
w = this.dtpSize
h = this.monitor.height * length - tbPadding - gsTopPanelOffset
dockMode = h < this.monitor.height
} else {
this.sizeFunc = 'get_preferred_width'
this.fixedCoord = { c1: 'y1', c2: 'y2' }
@@ -750,6 +754,7 @@ export const Panel = GObject.registerClass(
w = this.monitor.width * length - lrPadding
h = this.dtpSize
dockMode = w < this.monitor.width
}
if (position == St.Side.TOP || position == St.Side.LEFT) {
@@ -797,6 +802,7 @@ export const Panel = GObject.registerClass(
tbPadding,
position,
dynamic,
dockMode,
}
}
@@ -1044,6 +1050,12 @@ export const Panel = GObject.registerClass(
)
}
_maybeSetDockCss() {
this.remove_style_class_name('dock')
if (this.geom.dockMode) this.add_style_class_name('dock')
}
_setPanelPosition() {
let clipContainer = this.panelBox.get_parent()

View File

@@ -170,7 +170,7 @@
/* border radius, grrr no css variables in ST */
#uiGroup.br4 #dashtopanelPanel,
#uiGroup.br4 #dashtopanelPanel.dock,
#uiGroup.br4 .show-apps,
#uiGroup.br4 .dtp-container,
#uiGroup.br4 .dtp-dots-container,
@@ -181,11 +181,11 @@
border-radius: 4px !important;
overflow: hidden !important;
}
#uiGroup.br4 .showdesktop-button {
#uiGroup.br4 #dashtopanelPanel.dock .showdesktop-button {
border-radius: 0 4px 4px 0 !important;
}
#uiGroup.br8 #dashtopanelPanel,
#uiGroup.br8 #dashtopanelPanel.dock,
#uiGroup.br8 .show-apps,
#uiGroup.br8 .dtp-container,
#uiGroup.br8 .dtp-dots-container,
@@ -196,11 +196,11 @@
border-radius: 8px !important;
overflow: hidden !important;
}
#uiGroup.br8 .showdesktop-button {
#uiGroup.br8 #dashtopanelPanel.dock .showdesktop-button {
border-radius: 0 8px 8px 0 !important;
}
#uiGroup.br12 #dashtopanelPanel,
#uiGroup.br12 #dashtopanelPanel.dock,
#uiGroup.br12 .show-apps,
#uiGroup.br12 .dtp-container,
#uiGroup.br12 .dtp-dots-container,
@@ -211,11 +211,11 @@
border-radius: 12px !important;
overflow: hidden !important;
}
#uiGroup.br12 .showdesktop-button {
#uiGroup.br12 #dashtopanelPanel.dock .showdesktop-button {
border-radius: 0 12px 12px 0 !important;
}
#uiGroup.br16 #dashtopanelPanel,
#uiGroup.br16 #dashtopanelPanel.dock,
#uiGroup.br16 .show-apps,
#uiGroup.br16 .dtp-container,
#uiGroup.br16 .dtp-dots-container,
@@ -226,11 +226,11 @@
border-radius: 16px !important;
overflow: hidden !important;
}
#uiGroup.br16 .showdesktop-button {
#uiGroup.br16 #dashtopanelPanel.dock .showdesktop-button {
border-radius: 0 16px 16px 0 !important;
}
#uiGroup.br20 #dashtopanelPanel,
#uiGroup.br20 #dashtopanelPanel.dock,
#uiGroup.br20 .show-apps,
#uiGroup.br20 .dtp-container,
#uiGroup.br20 .dtp-dots-container,
@@ -241,6 +241,6 @@
border-radius: 20px !important;
overflow: hidden !important;
}
#uiGroup.br20 .showdesktop-button {
#uiGroup.br20 #dashtopanelPanel.dock .showdesktop-button {
border-radius: 0 20px 20px 0 !important;
}