Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon indicators everywhere #2267

Merged
merged 23 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
23e7347
notificationsMonitor: Try to get appId from the source if set
3v1n0 Aug 12, 2024
3b1e294
appIcons: Sync comment change with ubuntu-dock
3v1n0 Aug 13, 2024
9bb2787
appIcons: Fix comment typo
3v1n0 Aug 13, 2024
394df1d
appIcons: Remove duplicate source definition on DockAppIconMenu
3v1n0 Aug 13, 2024
728ccb8
stylesheet: Add missing declaration for overview tile states
3v1n0 Aug 13, 2024
4806a6e
appIcons: Allow to update the dot style offset in x too
3v1n0 Aug 13, 2024
4026a0d
appIcons: Show an OSD error if trying to launch an updating app
3v1n0 Aug 13, 2024
13e2e54
appIcons: Always add a disabled menu item with the app title
3v1n0 Aug 13, 2024
0533d7b
appIcons: Inform in menu items that the app is being being updated
3v1n0 Aug 13, 2024
9805c6b
appIcons: Delete menu instance from app icon on destruction
3v1n0 Aug 13, 2024
c46e5d2
appIcons: use upstream definition of shouldShowTooltip
3v1n0 Aug 13, 2024
3b2e913
docking: Patch AppIcon to have more consistent Pin labels
3v1n0 Aug 13, 2024
3ec5d82
appIcons: Use a labeled menu item separator for application title
3v1n0 Aug 13, 2024
44af4f2
appIcons: Drop code that is not used anymore by any supported version
3v1n0 Aug 13, 2024
52f23fa
appIconIndicator: Move style handling for updating state here
3v1n0 Aug 24, 2024
828aaf1
appIcons: Setup unity indicator properties on construction
3v1n0 Aug 24, 2024
5330a66
appIconsDecorator: Support decorating app icons with emblems everywhere
3v1n0 Aug 24, 2024
12b0559
launcherAPI: Avoid using regexes to replace all values in a string
3v1n0 Aug 24, 2024
9753f20
appIndicators: Allow theming progress offsets
3v1n0 Aug 24, 2024
aadda1c
utils: Support injecting properties that are not on the main object
3v1n0 Aug 24, 2024
c43b340
appIconsDecorator: Update icons style on updating changes
3v1n0 Aug 24, 2024
48a7aac
appIconsDecorator: Do not allow launching any application in updating…
3v1n0 Aug 24, 2024
070f2a8
appIconsDecorator: Hide all menu items except unpinning ones on updating
3v1n0 Aug 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ EXTRA_MODULES = \
dash.js \
docking.js \
appIcons.js \
appIconsDecorator.js \
appIconIndicators.js \
fileManager1API.js \
imports.js \
Expand All @@ -36,7 +37,9 @@ EXTRA_MEDIA = logo.svg \
$(NULL)

TOLOCALIZE = prefs.js \
docking.js \
appIcons.js \
appIconsDecorator.js \
locations.js \
$(NULL)

Expand Down
28 changes: 23 additions & 5 deletions _stylesheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,17 @@ $dock_style_modes: [null, shrink, extended, extended-shrink];
};
}

.app-well-app {
.app-well-app,
.overview-tile {
&.running .overview-icon {
background-image: none;
}
&.focused .overview-icon {
background-color: $remark_color;
}

.app-well-app-running-dot {
.app-well-app-running-dot,
.app-grid-running-dot {
margin-bottom: 2px;
}
}
Expand Down Expand Up @@ -362,7 +364,9 @@ $dock_style_modes: [null, shrink, extended, extended-shrink];
background: $dash_background_color;
}

#dashtodockContainer.dashtodock .progress-bar {
#dashtodockContainer.dashtodock .progress-bar,
.overview-tile .progress-bar,
.icon-grid .progress-bar {
/* Customization of the progress bar style. The possible elements
* are:
*
Expand Down Expand Up @@ -407,13 +411,23 @@ $dock_style_modes: [null, shrink, extended, extended-shrink];
* -progress-bar-background: 204, 204, 204, 1.0
* -progress-bar-border: 230, 230, 230, 1.0
* -progress-bar-line-width: 1
* -progress-bar-top-offset: undefined
* -progress-bar-valign: 1.0
*/
-progress-bar-track-background: rgba(0, 0, 0, 0.45);
-progress-bar-track-border: rgba(0, 0, 0, 0.7);
-progress-bar-background: rgba(255, 255, 255, 1.0);
-progress-bar-border: rgba(255, 255, 255, 1.0);
}

#overview,
.apps-scroll-view {
.progress-bar {
-progress-bar-top-offset: 0;
-progress-bar-valign: 0.8;
}
}

#dashtodockContainer.top #dash .placeholder,
#dashtodockContainer.bottom #dash .placeholder {
width: 32px;
Expand All @@ -440,13 +454,17 @@ $dock_style_modes: [null, shrink, extended, extended-shrink];
transition-duration: 500ms;
}

#dashtodockContainer .number-overlay {
#dashtodockContainer .number-overlay,
.overview-tile .number-overlay,
.icon-grid .number-overlay {
color: rgba(255, 255, 255, 1);
background-color: rgba(0, 0, 0, 0.8);
text-align: center;
}

#dashtodockContainer .notification-badge {
#dashtodockContainer .notification-badge,
.overview-tile .notification-badge,
.icon-grid .notification-badge {
color: rgba(255, 255, 255, 1);
background-color: rgba(255, 0, 0, 1);
padding: 0.2em 0.5em;
Expand Down
38 changes: 34 additions & 4 deletions appIconIndicators.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ class RunningIndicatorBinary extends RunningIndicatorDots {
/*
* Unity like notification and progress indicators
*/
class UnityIndicator extends IndicatorBase {
export class UnityIndicator extends IndicatorBase {
static defaultProgressBar = {
// default values for the progress bar itself
background: {
Expand Down Expand Up @@ -755,7 +755,17 @@ class UnityIndicator extends IndicatorBase {
this._source._iconContainer,
'notify::size',
this.updateNotificationBadgeStyle.bind(this),
], [
this._source,
'style-changed',
() => this._updateIconStyle(),
]);

this._updateNotificationsCount();
this.setProgress(this._remoteEntry.progress_visible
? this._remoteEntry.progress : -1);
this.setUrgent(this._remoteEntry.urgent);
this.setUpdating(this._remoteEntry.updating);
}

destroy() {
Expand Down Expand Up @@ -943,20 +953,30 @@ class UnityIndicator extends IndicatorBase {
const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
const [surfaceWidth, surfaceHeight] = area.get_surface_size();
const cr = area.get_context();

const node = this._progressOverlayArea.get_theme_node();
const iconSize = this._source.icon.iconSize * scaleFactor;

let x = Math.floor((surfaceWidth - iconSize) / 2);
let y = Math.floor((surfaceHeight - iconSize) / 2);

const [hasTopOffset, topOffset] = node.lookup_double(
'-progress-bar-top-offset', false);
if (hasTopOffset)
y = topOffset;

const baseLineWidth = Math.floor(Number(scaleFactor));
const padding = Math.floor(iconSize * 0.05);
let width = iconSize - 2.0 * padding;
let height = Math.floor(Math.min(18.0 * scaleFactor, 0.20 * iconSize));
x += padding;
y += iconSize - height - padding;

const node = this._progressOverlayArea.get_theme_node();
const valignParameters = node.lookup_double(
'-progress-bar-valign', false);
const [hasValign] = valignParameters;
let [, valign] = valignParameters;
if (!hasValign)
valign = 1.0;
y += (iconSize - height - padding) * valign;

const progressBarTrack = this._readElementData(node,
'-progress-bar-track',
Expand Down Expand Up @@ -1027,6 +1047,16 @@ class UnityIndicator extends IndicatorBase {
setUpdating(updating) {
this._source.updating = updating;
}

_updateIconStyle() {
const opacityLookup =
this._source.get_theme_node().lookup_double('opacity', true);
const [hasOpacity] = opacityLookup;
let [, opacity] = opacityLookup;
if (!hasOpacity)
opacity = this._source.updating ? 0.5 : 1;
this._source.icon.set_opacity(255 * opacity);
}
}


Expand Down
Loading