feat: menu-bar-only app (no Dock icon) + macOS app icon

- NSApplicationActivationPolicyAccessory: app hidden from Dock and
  app switcher; lives only in the menu bar tray
- resources/clouck.icns: programmatic icon (green gradient rounded
  square, white dial, 10:10 hands), all sizes 16-1024 incl @2x
- CMake: MACOSX_BUNDLE_ICON_FILE wired, icns shipped in Resources/
This commit is contained in:
2026-08-27 22:31:06 +03:00
parent d9008479c1
commit db02df7ca2
5 changed files with 22 additions and 0 deletions
+8
View File
@@ -47,10 +47,18 @@ elseif(APPLE)
list(APPEND HEADERS window_helper_macos.h)
endif()
# macOS app icon
if(APPLE)
set(MACOSX_BUNDLE_ICON_FILE clouck.icns)
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/resources/clouck.icns)
set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
endif()
# Create executable
qt6_add_executable(Clouck WIN32 MACOSX_BUNDLE
${SOURCES}
${HEADERS}
${APP_ICON_MACOSX}
)
# Platform-specific sources and libraries
+3
View File
@@ -42,6 +42,9 @@ public:
QMenu *menu() const { return m_contextMenu; }
QString primaryTimeZoneId() const { return m_primaryTimeZoneId; }
QString secondaryTimeZoneId() const { return m_secondaryTimeZoneId; }
protected:
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
+6
View File
@@ -49,6 +49,12 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
// Menu-bar-only app: no Dock icon, no app switcher entry.
#ifdef Q_OS_MAC
extern void clouck_setActivationPolicyAccessory(); // defined in window_helper_macos.mm
clouck_setActivationPolicyAccessory();
#endif
app.setApplicationName("Clouck");
app.setOrganizationName("Clouck");
app.setApplicationDisplayName("Clouck");
Binary file not shown.
+5
View File
@@ -36,4 +36,9 @@ void MacOSWindowHelper::setupAlwaysOnTopForFullscreen(QWidget *widget)
}
}
void clouck_setActivationPolicyAccessory()
{
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
}
#endif // Q_OS_MAC