From 3dd7b8c53f49515a88fe8e40aeaa04157cf506d7 Mon Sep 17 00:00:00 2001 From: "user.email" Date: Thu, 20 Aug 2026 20:03:22 +0530 Subject: [PATCH 1/3] feat(wallpaper): add current wallpaer to favorites --- assets/translations/en.json | 1 + src/shell/wallpaper/panel/wallpaper_panel.cpp | 24 +++++++++++++++++++ src/shell/wallpaper/panel/wallpaper_panel.h | 1 + 3 files changed, 26 insertions(+) diff --git a/assets/translations/en.json b/assets/translations/en.json index ad2daa813f..bbadf55090 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -4092,6 +4092,7 @@ "color-title": "Wallpaper color", "filter-placeholder": "Filter…", "flatten": "Flatten", + "favorite-current": "Add current wallpaper to favorites", "loading": "Loading wallpapers…", "sort-date-asc": "Sort by date (oldest first)", "sort-date-desc": "Sort by date (newest first)", diff --git a/src/shell/wallpaper/panel/wallpaper_panel.cpp b/src/shell/wallpaper/panel/wallpaper_panel.cpp index 4355190855..bae2f7be25 100644 --- a/src/shell/wallpaper/panel/wallpaper_panel.cpp +++ b/src/shell/wallpaper/panel/wallpaper_panel.cpp @@ -463,6 +463,23 @@ void WallpaperPanel::create() { }) ); + toolbar->addChild( + ui::button({ + .out = &m_favoriteCurrentButton, + .glyph = "star", + .glyphSize = Style::fontSizeBody * scale, + .variant = ButtonVariant::Default, + .minWidth = Style::controlHeightSm * scale, + .minHeight = Style::controlHeightSm * scale, + .padding = Style::spaceXs * scale, + .radius = Style::scaledRadiusMd(scale), + .onClick = [this]() { toggleFavoriteForPath(currentWallpaperPathForSelection()); }, + }) + ); + if (m_favoriteCurrentButton != nullptr) { + m_favoriteCurrentButton->setTooltip(i18n::tr("wallpaper.panel.favorite-current")); + } + toolbar->addChild(ui::spacer()); toolbar->addChild( @@ -901,6 +918,7 @@ void WallpaperPanel::onClose() { m_title = nullptr; m_backButton = nullptr; m_monitorSelect = nullptr; + m_favoriteCurrentButton = nullptr; m_filterInput = nullptr; m_flattenToggle = nullptr; m_flattenLabel = nullptr; @@ -1087,6 +1105,11 @@ void WallpaperPanel::syncBrowseChrome() { if (m_backButton != nullptr) { m_backButton->setVisible(!m_navStack.empty()); } + if (m_favoriteCurrentButton != nullptr && m_config != nullptr) { + const std::string current = currentWallpaperPathForSelection(); + m_favoriteCurrentButton->setEnabled(!current.empty()); + m_favoriteCurrentButton->setGlyph(m_config->isWallpaperFavorite(current) ? "star-filled" : "star"); + } syncThemeControls(); } @@ -1409,6 +1432,7 @@ void WallpaperPanel::applyWallpaperPath(const std::string& path, const Wallpaper choice.connector.empty() ? std::optional{} : std::optional{choice.connector}; m_config->applyWallpaperSelection(connector, path, applyTheme, allMonitorConnectors()); rebindGrid(); + syncBrowseChrome(); } const WallpaperFavorite* WallpaperPanel::favoriteThemeToApply(std::string_view path) const { diff --git a/src/shell/wallpaper/panel/wallpaper_panel.h b/src/shell/wallpaper/panel/wallpaper_panel.h index b8c56ff180..b17f199d03 100644 --- a/src/shell/wallpaper/panel/wallpaper_panel.h +++ b/src/shell/wallpaper/panel/wallpaper_panel.h @@ -136,6 +136,7 @@ class WallpaperPanel : public Panel { Select* m_favoritePaletteDetailSelect = nullptr; Select* m_monitorSelect = nullptr; Input* m_filterInput = nullptr; + Button* m_favoriteCurrentButton = nullptr; Toggle* m_flattenToggle = nullptr; Label* m_flattenLabel = nullptr; Button* m_sortButton = nullptr; From 18542d621295fc341dc12fbb9df7769aa38ca00b Mon Sep 17 00:00:00 2001 From: "user.email" Date: Tue, 1 Sep 2026 00:09:38 +0530 Subject: [PATCH 2/3] star placement change --- src/shell/wallpaper/panel/wallpaper_panel.cpp | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/shell/wallpaper/panel/wallpaper_panel.cpp b/src/shell/wallpaper/panel/wallpaper_panel.cpp index bae2f7be25..52009e2cfb 100644 --- a/src/shell/wallpaper/panel/wallpaper_panel.cpp +++ b/src/shell/wallpaper/panel/wallpaper_panel.cpp @@ -463,23 +463,6 @@ void WallpaperPanel::create() { }) ); - toolbar->addChild( - ui::button({ - .out = &m_favoriteCurrentButton, - .glyph = "star", - .glyphSize = Style::fontSizeBody * scale, - .variant = ButtonVariant::Default, - .minWidth = Style::controlHeightSm * scale, - .minHeight = Style::controlHeightSm * scale, - .padding = Style::spaceXs * scale, - .radius = Style::scaledRadiusMd(scale), - .onClick = [this]() { toggleFavoriteForPath(currentWallpaperPathForSelection()); }, - }) - ); - if (m_favoriteCurrentButton != nullptr) { - m_favoriteCurrentButton->setTooltip(i18n::tr("wallpaper.panel.favorite-current")); - } - toolbar->addChild(ui::spacer()); toolbar->addChild( @@ -681,6 +664,23 @@ void WallpaperPanel::create() { }) ); + favoritesOptions->addChild( + ui::button({ + .out = &m_favoriteCurrentButton, + .glyph = "star", + .glyphSize = Style::fontSizeBody * scale, + .variant = ButtonVariant::Default, + .minWidth = Style::controlHeightSm * scale, + .minHeight = Style::controlHeightSm * scale, + .padding = Style::spaceXs * scale, + .radius = Style::scaledRadiusMd(scale), + .onClick = [this]() { toggleFavoriteForPath(currentWallpaperPathForSelection()); }, + }) + ); + if (m_favoriteCurrentButton != nullptr) { + m_favoriteCurrentButton->setTooltip(i18n::tr("wallpaper.panel.favorite-current")); + } + favoritesOptions->addChild(ui::spacer()); favoritesOptions->addChild( From 67962e8c67c57a8c62e85c1d5aacc39ac287e222 Mon Sep 17 00:00:00 2001 From: Lemmy Date: Wed, 2 Sep 2026 09:42:25 -0400 Subject: [PATCH 3/3] ui(wallpaper): add tooltips to icon buttons --- assets/translations/en.json | 5 +++++ src/shell/wallpaper/panel/wallpaper_panel.cpp | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/assets/translations/en.json b/assets/translations/en.json index bbadf55090..ab57ac53f7 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -4093,6 +4093,11 @@ "filter-placeholder": "Filter…", "flatten": "Flatten", "favorite-current": "Add current wallpaper to favorites", + "unfavorite-current": "Remove current wallpaper from favorites", + "choose-color": "Choose wallpaper color", + "close": "Close wallpaper panel", + "navigate-up": "Go to parent folder", + "refresh": "Refresh wallpapers", "loading": "Loading wallpapers…", "sort-date-asc": "Sort by date (oldest first)", "sort-date-desc": "Sort by date (newest first)", diff --git a/src/shell/wallpaper/panel/wallpaper_panel.cpp b/src/shell/wallpaper/panel/wallpaper_panel.cpp index 52009e2cfb..dd1c5e9631 100644 --- a/src/shell/wallpaper/panel/wallpaper_panel.cpp +++ b/src/shell/wallpaper/panel/wallpaper_panel.cpp @@ -455,6 +455,7 @@ void WallpaperPanel::create() { .glyph = "arrow-big-up", .glyphSize = Style::fontSizeBody * scale, .variant = ButtonVariant::Secondary, + .tooltip = i18n::tr("wallpaper.panel.navigate-up"), .minWidth = Style::controlHeightSm * scale, .minHeight = Style::controlHeightSm * scale, .padding = Style::spaceXs * scale, @@ -521,6 +522,7 @@ void WallpaperPanel::create() { .glyph = "color-picker", .glyphSize = Style::fontSizeBody * scale, .variant = ButtonVariant::Default, + .tooltip = i18n::tr("wallpaper.panel.choose-color"), .minWidth = Style::controlHeightSm * scale, .minHeight = Style::controlHeightSm * scale, .padding = Style::spaceXs * scale, @@ -535,6 +537,7 @@ void WallpaperPanel::create() { .glyph = std::string(sortModeGlyph(m_sortMode)), .glyphSize = Style::fontSizeBody * scale, .variant = ButtonVariant::Default, + .tooltip = i18n::tr(sortModeTooltipKey(m_sortMode)), .minWidth = Style::controlHeightSm * scale, .minHeight = Style::controlHeightSm * scale, .padding = Style::spaceXs * scale, @@ -549,6 +552,7 @@ void WallpaperPanel::create() { .glyph = "refresh", .glyphSize = Style::fontSizeBody * scale, .variant = ButtonVariant::Default, + .tooltip = i18n::tr("wallpaper.panel.refresh"), .minWidth = Style::controlHeightSm * scale, .minHeight = Style::controlHeightSm * scale, .padding = Style::spaceXs * scale, @@ -572,6 +576,7 @@ void WallpaperPanel::create() { .out = &m_closeButton, .glyph = "close", .glyphSize = Style::fontSizeBody * scale, + .tooltip = i18n::tr("wallpaper.panel.close"), .minWidth = Style::controlHeightSm * scale, .minHeight = Style::controlHeightSm * scale, .padding = Style::spaceXs * scale, @@ -670,6 +675,7 @@ void WallpaperPanel::create() { .glyph = "star", .glyphSize = Style::fontSizeBody * scale, .variant = ButtonVariant::Default, + .tooltip = i18n::tr("wallpaper.panel.favorite-current"), .minWidth = Style::controlHeightSm * scale, .minHeight = Style::controlHeightSm * scale, .padding = Style::spaceXs * scale, @@ -677,9 +683,6 @@ void WallpaperPanel::create() { .onClick = [this]() { toggleFavoriteForPath(currentWallpaperPathForSelection()); }, }) ); - if (m_favoriteCurrentButton != nullptr) { - m_favoriteCurrentButton->setTooltip(i18n::tr("wallpaper.panel.favorite-current")); - } favoritesOptions->addChild(ui::spacer()); @@ -1107,8 +1110,12 @@ void WallpaperPanel::syncBrowseChrome() { } if (m_favoriteCurrentButton != nullptr && m_config != nullptr) { const std::string current = currentWallpaperPathForSelection(); + const bool favorite = !current.empty() && m_config->isWallpaperFavorite(current); m_favoriteCurrentButton->setEnabled(!current.empty()); - m_favoriteCurrentButton->setGlyph(m_config->isWallpaperFavorite(current) ? "star-filled" : "star"); + m_favoriteCurrentButton->setGlyph(favorite ? "star-filled" : "star"); + m_favoriteCurrentButton->setTooltip( + i18n::tr(favorite ? "wallpaper.panel.unfavorite-current" : "wallpaper.panel.favorite-current") + ); } syncThemeControls(); }