ide: MacOS bundle icon option

This commit is contained in:
Mirek Fidler 2026-01-13 14:01:32 +01:00
parent d4bae3cd09
commit 45c97406ca
6 changed files with 27 additions and 14 deletions

View file

@ -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;

View file

@ -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);

View file

@ -571,13 +571,15 @@ void Ide::SetIdeState(int newstate)
void Ide::MakeIcon() {
#ifdef PLATFORM_COCOA
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))
{

View file

@ -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

View file

@ -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

View file

@ -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();