From 45c97406ca5951a416be403309811a1c5be1ca62 Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Tue, 13 Jan 2026 14:01:32 +0100 Subject: [PATCH] ide: MacOS bundle icon option --- uppsrc/ide/Config.cpp | 4 +++- uppsrc/ide/Setup.cpp | 7 ++++++- uppsrc/ide/ide.cpp | 12 +++++++----- uppsrc/ide/ide.h | 1 + uppsrc/ide/ide.lay | 9 +++++---- uppsrc/ide/main.cpp | 8 +++++--- 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/uppsrc/ide/Config.cpp b/uppsrc/ide/Config.cpp index 6ec6d15ae..0d34cea6f 100644 --- a/uppsrc/ide/Config.cpp +++ b/uppsrc/ide/Config.cpp @@ -187,7 +187,7 @@ void Sentinel(Stream& s, const char *txt) void Ide::Serialize(Stream& s) { - int version = 35; + int version = 36; Sentinel(s, "before 12341234"); s.Magic(0x12341234); Sentinel(s, "after magic"); @@ -280,6 +280,8 @@ void Ide::Serialize(Stream& s) s % libclang_options; if(version >= 24) s % libclang_coptions; + if(version >= 36) + s % macos_update_icon; SerializeGlobalConfigs(s); doc.Serialize(s); s % right_split; diff --git a/uppsrc/ide/Setup.cpp b/uppsrc/ide/Setup.cpp index 6f0978cfa..e2336db32 100644 --- a/uppsrc/ide/Setup.cpp +++ b/uppsrc/ide/Setup.cpp @@ -385,6 +385,10 @@ void Ide::SetupFormat() { } #endif +#ifndef GUI_COCOA + ide.update_icon.Hide(); +#endif + bool show_basic_hints = IsBasicHintsEnabled(); rtvr @@ -462,6 +466,7 @@ void Ide::SetupFormat() { (ide.search_downloads, search_downloads) (ide.show_basic_hints, show_basic_hints) (ide.valgrind, valgrind_options) + (ide.update_icon, macos_update_icon) ; hlt.hlstyle.AddColumn("Style"); hlt.hlstyle.AddColumn("Color").Ctrls(HlPusherFactory); @@ -592,7 +597,7 @@ void Ide::SetupFormat() { CurrentFileDeleteCache(); editor.SyncCurrentFile(); } - + #ifdef GUI_GTK if(IsWayland() || IsXWayland()) { if(FileExists(use_wayland_path) != ide.wayland) { diff --git a/uppsrc/ide/ide.cpp b/uppsrc/ide/ide.cpp index 54910ce6d..1321162b2 100644 --- a/uppsrc/ide/ide.cpp +++ b/uppsrc/ide/ide.cpp @@ -571,13 +571,15 @@ void Ide::SetIdeState(int newstate) void Ide::MakeIcon() { #ifdef PLATFORM_COCOA - String badge = IsOpen() ? main : ""; - SetBadgeLabel(badge); - return; + if(!macos_update_icon) { + String badge = IsOpen() ? main : ""; + SetBadgeLabel(badge); + return; + } #endif - + Image li = IdeImg::Icon256(); -#ifndef PLATFORM_POSIX // Kubuntu is using this icon for window while ignoring it in taskbar... +#ifndef PLATFORM_LINUX // Kubuntu is using this icon for window while ignoring it in taskbar... WString mp = main.ToWString(); if(!IsNull(mp)) { diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index b3b29d5bf..4167b3457 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -672,6 +672,7 @@ public: bool win_deactivated = false; bool block_caret = false; bool bar_branch = true; + bool macos_update_icon = false; bool search_downloads = #ifdef PLATFORM_MACOS false diff --git a/uppsrc/ide/ide.lay b/uppsrc/ide/ide.lay index c56b19843..a9be76b08 100644 --- a/uppsrc/ide/ide.lay +++ b/uppsrc/ide/ide.lay @@ -645,12 +645,13 @@ LAYOUT(SetupIdeLayout, 512, 400) ITEM(Upp::Label, dv___14, SetLabel(t_("GUI theme")).LeftPosZ(4, 112).TopPosZ(212, 19)) ITEM(Upp::DropList, chstyle, LeftPosZ(120, 144).TopPosZ(212, 19)) ITEM(Upp::Option, wayland, SetLabel(t_("Use Wayland (experimental, needs restart)")).LeftPosZ(272, 408).TopPosZ(212, 20)) + ITEM(Upp::Option, update_icon, SetLabel(t_("Override bundled icon (needs restart)")).LeftPosZ(272, 408).TopPosZ(212, 20)) ITEM(Upp::Option, gui_font, SetLabel(t_("Override GUI font")).LeftPosZ(4, 112).TopPosZ(236, 19)) ITEM(Upp::DropList, face, LeftPosZ(120, 144).TopPosZ(236, 19)) ITEM(Upp::DropList, height, LeftPosZ(268, 50).TopPosZ(236, 19)) ITEM(Upp::Option, bold, SetLabel(t_("Bold")).LeftPosZ(322, 44).TopPosZ(236, 19)) ITEM(Upp::Option, italic, SetLabel(t_("Italic")).LeftPosZ(370, 44).TopPosZ(236, 19)) - ITEM(Upp::Label, dv___22, SetLabel(t_("(needs restart)")).LeftPosZ(416, 88).TopPosZ(236, 19)) + ITEM(Upp::Label, dv___23, SetLabel(t_("(needs restart)")).LeftPosZ(416, 88).TopPosZ(236, 19)) ITEM(Upp::Label, console_txt, SetLabel(t_("Console binary")).LeftPosZ(4, 112).TopPosZ(260, 19)) ITEM(Upp::EditString, console, LeftPosZ(120, 380).TopPosZ(260, 19)) ITEM(Upp::Button, xterm, SetLabel(t_("xterm")).LeftPosZ(120, 60).TopPosZ(284, 20)) @@ -660,13 +661,13 @@ LAYOUT(SetupIdeLayout, 512, 400) ITEM(Upp::Button, lxde, SetLabel(t_("LXDE")).LeftPosZ(376, 60).TopPosZ(284, 20)) ITEM(Upp::Button, xfce, SetLabel(t_("XFCE")).LeftPosZ(440, 60).TopPosZ(284, 20)) ITEM(Upp::Option, output_per_assembly, SetLabel(t_("Use unique output directory per assembly (append assembly name to output directory)")).HSizePosZ(4, 4).TopPosZ(308, 16)) - ITEM(Upp::Label, dv___32, SetLabel(t_("In editor mode, path for .usc files")).LeftPosZ(4, 192).TopPosZ(328, 20)) + ITEM(Upp::Label, dv___33, SetLabel(t_("In editor mode, path for .usc files")).LeftPosZ(4, 192).TopPosZ(328, 20)) ITEM(Upp::EditString, uscpath, HSizePosZ(172, 28).TopPosZ(328, 19)) ITEM(Upp::Button, uscpath_sel, RightPosZ(4, 20).TopPosZ(328, 19)) - ITEM(Upp::Label, dv___35, SetLabel(t_("Default UppHub folder")).LeftPosZ(4, 192).TopPosZ(352, 20)) + ITEM(Upp::Label, dv___36, SetLabel(t_("Default UppHub folder")).LeftPosZ(4, 192).TopPosZ(352, 20)) ITEM(Upp::EditString, upphub, HSizePosZ(172, 28).TopPosZ(352, 19)) ITEM(Upp::Button, upphub_sel, RightPosZ(4, 20).TopPosZ(352, 19)) - ITEM(Upp::Label, dv___38, SetLabel(t_("Additional valgrind options")).LeftPosZ(4, 164).TopPosZ(376, 19)) + ITEM(Upp::Label, dv___39, SetLabel(t_("Additional valgrind options")).LeftPosZ(4, 164).TopPosZ(376, 19)) ITEM(Upp::EditString, valgrind, LeftPosZ(172, 336).TopPosZ(376, 19)) END_LAYOUT diff --git a/uppsrc/ide/main.cpp b/uppsrc/ide/main.cpp index 78bc14205..7bc91d52a 100644 --- a/uppsrc/ide/main.cpp +++ b/uppsrc/ide/main.cpp @@ -217,9 +217,6 @@ void AppMain___() Ctrl::SetDarkThemeEnabled(); Ctrl::SkinChangeSensitive(); Ctrl::SetAppName("TheIDE"); -#ifdef PLATFORM_COCOA - Ctrl::SetAlwaysUseBundledIcon(); -#endif SetLanguage(LNG_ENGLISH); SetDefaultCharset(CHARSET_UTF8); @@ -406,6 +403,11 @@ void AppMain___() ide.LoadConfig(); +#ifdef PLATFORM_COCOA + if(!ide.macos_update_icon) + Ctrl::SetAlwaysUseBundledIcon(); +#endif + if(!ide.disable_custom_caption) ide.CustomTitleBar();