Skip to content

Commit

Permalink
Merge pull request #2028 from philippun1/gnome-46
Browse files Browse the repository at this point in the history
Gnome 46
  • Loading branch information
charlesg99 committed Mar 24, 2024
2 parents 42eba9b + 9548560 commit 1f40909
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 75 deletions.
22 changes: 11 additions & 11 deletions appIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const TaskbarAppIcon = GObject.registerClass({
this._dotsContainer = new St.Widget({ layout_manager: new Clutter.BinLayout() });
this._dtpIconContainer = new St.Widget({ layout_manager: new Clutter.BinLayout(), style: getIconContainerStyle(panel.checkIfVertical()) });

this.remove_actor(this._iconContainer);
this.remove_child(this._iconContainer);

this._dtpIconContainer.add_child(this._iconContainer);

Expand Down Expand Up @@ -407,7 +407,7 @@ export const TaskbarAppIcon = GObject.registerClass({
// Workaround to prevent scaled icon from being ugly when it is animated on hover.
// It increases the "resolution" of the icon without changing the icon size.
this.icon.createIcon = (iconSize) => this.app.create_icon_texture(2 * iconSize);
this._iconIconBinActorAddedId = this.icon._iconBin.connect('actor-added', () => {
this._iconIconBinActorAddedId = this.icon._iconBin.connect('child-added', () => {
let size = this.icon.iconSize * Utils.getScaleFactor()

if (this.icon._iconBin.child.mapped) {
Expand Down Expand Up @@ -649,7 +649,7 @@ export const TaskbarAppIcon = GObject.registerClass({
// We want to keep the item hovered while the menu is up
this._menu.blockSourceEvents = true;

Main.uiGroup.add_actor(this._menu.actor);
Main.uiGroup.add_child(this._menu.actor);
this._menuManager.addMenu(this._menu);
}
this._menu.updateQuitText();
Expand Down Expand Up @@ -1107,29 +1107,29 @@ export const TaskbarAppIcon = GObject.registerClass({
if (type == DOT_STYLE.SOLID || type == DOT_STYLE.METRO) {
if (type == DOT_STYLE.SOLID || n <= 1) {
cr.translate(startX, startY);
Clutter.cairo_set_source_color(cr, bodyColor);
cr.setSourceColor(bodyColor);
cr.newSubPath();
cr.rectangle.apply(cr, [0, 0].concat(isHorizontalDots ? [areaSize, size] : [size, areaSize]));
cr.fill();
} 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 = bodyColor.shade(.3);
let darkenedColor = bodyColor.shade(.7);
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 solidDarkLength = areaSize - darkenedLength;
let solidLength = solidDarkLength - blackenedLength;

cr.translate(startX, startY);

Clutter.cairo_set_source_color(cr, bodyColor);
cr.setSourceColor(bodyColor);
cr.newSubPath();
cr.rectangle.apply(cr, [0, 0].concat(isHorizontalDots ? [solidLength, size] : [size, solidLength]));
cr.fill();
Clutter.cairo_set_source_color(cr, blackenedColor);
cr.setSourceColor(blackenedColor);
cr.newSubPath();
cr.rectangle.apply(cr, isHorizontalDots ? [solidLength, 0, 1, size] : [0, solidLength, size, 1]);
cr.fill();
Clutter.cairo_set_source_color(cr, darkenedColor);
cr.setSourceColor(darkenedColor);
cr.newSubPath();
cr.rectangle.apply(cr, isHorizontalDots ? [solidDarkLength, 0, darkenedLength, size] : [0, solidDarkLength, size, darkenedLength]);
cr.fill();
Expand Down Expand Up @@ -1200,7 +1200,7 @@ export const TaskbarAppIcon = GObject.registerClass({

translate();

Clutter.cairo_set_source_color(cr, bodyColor);
cr.setSourceColor(bodyColor);
preDraw();
for (let i = 0; i < n; i++) {
cr.newSubPath();
Expand Down Expand Up @@ -1697,7 +1697,7 @@ export const ShowAppsIconWrapper = class extends EventEmitter {
// We want to keep the item hovered while the menu is up
this._menu.blockSourceEvents = true;

Main.uiGroup.add_actor(this._menu.actor);
Main.uiGroup.add_child(this._menu.actor);
this._menuManager.addMenu(this._menu);
}
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"uuid": "[email protected]",
"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": [ "45" ],
"shell-version": [ "46" ],
"url": "https://github.com/home-sweet-gnome/dash-to-panel",
"gettext-domain": "dash-to-panel",
"version": 9999
Expand Down
6 changes: 3 additions & 3 deletions panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ export const Panel = GObject.registerClass({
],
[
this._centerBox,
'actor-added',
'child-added',
() => this._onBoxActorAdded(this._centerBox)
],
[
this._rightBox,
'actor-added',
'child-added',
() => this._onBoxActorAdded(this._rightBox)
],
[
Expand Down Expand Up @@ -553,7 +553,7 @@ export const Panel = GObject.registerClass({
let parent = this.statusArea[propName].container.get_parent();

if (parent) {
parent.remove_actor(this.statusArea[propName].container);
parent.remove_child(this.statusArea[propName].container);
}

//calling this.statusArea[propName].destroy(); is buggy for now, gnome-shell never
Expand Down
10 changes: 5 additions & 5 deletions panelManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const PanelManager = class {
Panel.panelBoxes.forEach(c => this._signalsHandler.add(
[
Main.panel[c],
'actor-added',
'child-added',
(parent, child) =>
this.primaryPanel &&
this._adjustPanelMenuButton(this._getPanelMenuButton(child), this.primaryPanel.monitor, this.primaryPanel.getPosition())
Expand Down Expand Up @@ -246,7 +246,7 @@ export const PanelManager = class {
} else {
p.panelBox.remove_child(p);
p.remove_child(p.panel);
p.panelBox.add(p.panel);
p.panelBox.add_child(p.panel);

p.panelBox.set_position(clipContainer.x, clipContainer.y);

Expand Down Expand Up @@ -363,7 +363,7 @@ export const PanelManager = class {
this._scrollAdjustment,
this._fitModeAdjustment,
this._overviewAdjustment);
Main.layoutManager.overviewGroup.add_actor(view);
Main.layoutManager.overviewGroup.add_child(view);
}

this._workspacesViews.push(view);
Expand Down Expand Up @@ -421,7 +421,7 @@ export const PanelManager = class {
Main.layoutManager.trackChrome(panelBox, { trackFullscreen: true, affectsStruts: true, affectsInputRegion: true });

panel = new Panel.Panel(this, monitor, panelBox, isStandalone);
panelBox.add(panel);
panelBox.add_child(panel);
panel.enable();

panelBox.visible = true;
Expand Down Expand Up @@ -737,7 +737,7 @@ function newUpdatePanelBarrier(panel) {

Object.keys(barriers).forEach(k => {
let barrierOptions = {
display: global.display,
backend: global.backend,
directions: barriers[k][2]
};

Expand Down
6 changes: 3 additions & 3 deletions panelStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,23 @@ export const PanelStyle = class {
this._applyStylesRecursively();

/* connect signal */
this._rightBoxActorAddedID = this.panel._rightBox.connect('actor-added',
this._rightBoxActorAddedID = this.panel._rightBox.connect('child-added',
(container, actor) => {
if(this._rightBoxOperations.length && !this._ignoreAddedChild)
this._recursiveApply(actor, this._rightBoxOperations);

this._ignoreAddedChild = 0;
}
);
this._centerBoxActorAddedID = this.panel._centerBox.connect('actor-added',
this._centerBoxActorAddedID = this.panel._centerBox.connect('child-added',
(container, actor) => {
if(this._centerBoxOperations.length && !this._ignoreAddedChild)
this._recursiveApply(actor, this._centerBoxOperations);

this._ignoreAddedChild = 0;
}
);
this._leftBoxActorAddedID = this.panel._leftBox.connect('actor-added',
this._leftBoxActorAddedID = this.panel._leftBox.connect('child-added',
(container, actor) => {
if(this._leftBoxOperations.length)
this._recursiveApply(actor, this._leftBoxOperations);
Expand Down
30 changes: 9 additions & 21 deletions stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,34 @@
padding: 0;
}

#dashtopanelScrollview .app-well-app .overview-icon,
.dashtopanelMainPanel .show-apps .overview-icon {
#dashtopanelScrollview .overview-tile,
.dashtopanelMainPanel .overview-tile {
background: none;
border: none;
margin: 0;
padding: 0;
}

#dashtopanelScrollview .app-well-app .overview-label {
#dashtopanelScrollview .overview-tile .overview-label {
/* must match TITLE_RIGHT_PADDING in apppicons.js */
padding-right: 8px;
text-align: left;
}

#dashtopanelScrollview .app-well-app:hover .overview-icon,
#dashtopanelScrollview .app-well-app:focus .overview-icon {
background: none;
}

.dashtopanelMainPanel .show-apps:hover .overview-icon,
#dashtopanelScrollview .app-well-app:hover .dtp-container,
#dashtopanelScrollview .app-well-app:focus .dtp-container {
#dashtopanelScrollview .overview-tile:hover .dtp-container,
#dashtopanelScrollview .overview-tile:focus .dtp-container {
background-color: rgba(238, 238, 236, 0.1);
}

#dashtopanelScrollview .app-well-app:hover .dtp-container.animate-appicon-hover {
#dashtopanelScrollview .overview-tile:hover .dtp-container.animate-appicon-hover {
background: none;
}

#dashtopanelScrollview .app-well-app:active .dtp-container {
#dashtopanelScrollview .overview-tile:active .dtp-container {
background-color: rgba(238, 238, 236, 0.18);
}

#dashtopanelScrollview .app-well-app .favorite {
#dashtopanelScrollview .overview-tile .favorite {
background-color: rgba(80, 150, 255, 0.4);
}

#dashtopanelScrollview .app-well-app-running-dot {
margin-bottom: 0;
}

#dashtopanelTaskbar .scrollview-fade {
background-gradient-end: rgba(0, 0, 0, 0);
}
Expand Down
33 changes: 9 additions & 24 deletions taskbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const TaskbarActor = GObject.registerClass({

scrollview.allocate(childBox);

let [value, , upper, , , pageSize] = scrollview[orientation[0] + 'scroll'].adjustment.get_values();
let [value, , upper, , , pageSize] = scrollview[orientation[0] + 'adjustment'].get_values();
upper = Math.floor(upper);
scrollview._dtpFadeSize = upper > pageSize ? this._delegate.iconSize : 0;

Expand Down Expand Up @@ -227,7 +227,7 @@ export const Taskbar = class extends EventEmitter {
this._scrollView.connect('leave-event', this._onLeaveEvent.bind(this));
this._scrollView.connect('motion-event', this._onMotionEvent.bind(this));
this._scrollView.connect('scroll-event', this._onScrollEvent.bind(this));
this._scrollView.add_actor(this._box);
this._scrollView.add_child(this._box);

this._showAppsIconWrapper = panel.showAppsIconWrapper;
this._showAppsIconWrapper.connect('menu-state-changed', (showAppsIconWrapper, opened) => {
Expand All @@ -251,7 +251,7 @@ export const Taskbar = class extends EventEmitter {
this._hookUpLabel(this._showAppsIcon, this._showAppsIconWrapper);

this._container.add_child(new St.Widget({ width: 0, reactive: false }));
this._container.add_actor(this._scrollView);
this._container.add_child(this._scrollView);

let orientation = panel.getOrientation();
let fadeStyle = 'background-gradient-direction:' + orientation;
Expand All @@ -264,8 +264,8 @@ export const Taskbar = class extends EventEmitter {
fade1.set_style(fadeStyle);
fade2.set_style(fadeStyle);

this._container.add_actor(fade1);
this._container.add_actor(fade2);
this._container.add_child(fade1);
this._container.add_child(fade2);

this.previewMenu = new WindowPreview.PreviewMenu(panel);
this.previewMenu.enable();
Expand All @@ -277,7 +277,7 @@ export const Taskbar = class extends EventEmitter {
x_align: rtl ? Clutter.ActorAlign.END : Clutter.ActorAlign.START
});

let adjustment = this._scrollView[orientation[0] + 'scroll'].adjustment;
const adjustment = this._scrollView[orientation[0] + 'adjustment'];

this._workId = Main.initializeDeferredWork(this._box, this._redisplay.bind(this));

Expand Down Expand Up @@ -514,7 +514,7 @@ export const Taskbar = class extends EventEmitter {

let adjustment, delta;

adjustment = this._scrollView[orientation[0] + 'scroll'].get_adjustment();
adjustment = this._scrollView[orientation[0] + 'adjustment'];

let increment = adjustment.step_increment;

Expand Down Expand Up @@ -1324,21 +1324,6 @@ export const Taskbar = class extends EventEmitter {
}
};

const CloneContainerConstraint = GObject.registerClass({
}, class CloneContainerConstraint extends Clutter.BindConstraint {

vfunc_update_allocation(actor, actorBox) {
if (!this.source)
return;

let [stageX, stageY] = this.source.get_transformed_position();
let [width, height] = this.source.get_transformed_size();

actorBox.set_origin(stageX, stageY);
actorBox.set_size(width, height);
}
});

export const TaskbarItemContainer = GObject.registerClass({

}, class TaskbarItemContainer extends Dash.DashItemContainer {
Expand Down Expand Up @@ -1442,7 +1427,7 @@ export const TaskbarItemContainer = GObject.registerClass({
});

this._raisedClone.source.opacity = 0;
Main.uiGroup.add_actor(cloneContainer);
Main.uiGroup.add_child(cloneContainer);
}

// Animate the clone.
Expand Down Expand Up @@ -1544,7 +1529,7 @@ const DragPlaceholderItem = GObject.registerClass({
height: iconSize
});

this.add_actor(this._clone);
this.add_child(this._clone);
}

destroy() {
Expand Down
2 changes: 1 addition & 1 deletion ui/BoxIntellihideOptions.ui
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Keyboard shortcut to reveal and hold the panel</property>
<property name="subtitle" translatable="yes">Syntax: &lt;Shift&gt;, &lt;Ctrl&gt;, &lt;Alt&gt;, &lt;Super&gt;</property>
<property name="subtitle" translatable="yes">Syntax: &amp;lt;Shift&amp;gt;, &amp;lt;Ctrl&amp;gt;, &amp;lt;Alt&amp;gt;, &amp;lt;Super&amp;gt;</property>
<child>
<object class="GtkEntry" id="intellihide_toggle_entry">
<property name="valign">center</property>
Expand Down
2 changes: 1 addition & 1 deletion ui/BoxOverlayShortcut.ui
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Shortcut to show the overlay for 2 seconds</property>
<property name="subtitle" translatable="yes">Syntax: &lt;Shift&gt;, &lt;Ctrl&gt;, &lt;Alt&gt;, &lt;Super&gt;</property>
<property name="subtitle" translatable="yes">Syntax: &amp;lt;Shift&amp;gt;, &amp;lt;Ctrl&amp;gt;, &amp;lt;Alt&amp;gt;, &amp;lt;Super&amp;gt;</property>
<child>
<object class="GtkEntry" id="shortcut_entry">
<property name="valign">center</property>
Expand Down
4 changes: 2 additions & 2 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ export const notify = function(text, iconName, action, isTransient) {
* Return the amount of shift applied
*/
export const ensureActorVisibleInScrollView = function(scrollView, actor, fadeSize, onComplete) {
let vadjustment = scrollView.vscroll.adjustment;
let hadjustment = scrollView.hscroll.adjustment;
const vadjustment = scrollView.vadjustment;
const hadjustment = scrollView.hadjustment;
let [vvalue, vlower, vupper, vstepIncrement, vpageIncrement, vpageSize] = vadjustment.get_values();
let [hvalue, hlower, hupper, hstepIncrement, hpageIncrement, hpageSize] = hadjustment.get_values();

Expand Down
6 changes: 3 additions & 3 deletions windowPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const PreviewMenu = GObject.registerClass({
y_expand: !this.isVertical
});

this._scrollView.add_actor(this._box);
this._scrollView.add_child(this._box);
this.menu.add_child(this._scrollView);
this.add_child(this.menu);
}
Expand Down Expand Up @@ -509,7 +509,7 @@ export const PreviewMenu = GObject.registerClass({
}

_getScrollAdjustmentValues() {
let [value , , upper, , , pageSize] = this._scrollView[(this.isVertical ? 'v' : 'h') + 'scroll'].adjustment.get_values();
let [value , , upper, , , pageSize] = this._scrollView[(this.isVertical ? 'v' : 'h') + 'adjustment'].get_values();

return [value, upper, pageSize];
}
Expand Down Expand Up @@ -712,7 +712,7 @@ export const Preview = GObject.registerClass({
let [previewBinWidth, previewBinHeight] = this._getBinSize();
let closeButton = new St.Button({ style_class: 'window-close', accessible_name: 'Close window' });

closeButton.add_actor(new St.Icon({ icon_name: 'window-close-symbolic' }));
closeButton.add_child(new St.Icon({ icon_name: 'window-close-symbolic' }));

this._closeButtonBin = new St.Widget({
style_class: 'preview-close-btn-container',
Expand Down

0 comments on commit 1f40909

Please sign in to comment.