feat: tray-first UX, text outline, start-at-login toggle, font max 200

- All settings move to flat tray menu; right-click on clock disabled
- ClockLabel: custom QPainterPath text rendering with configurable
  glyph outline (BorderColor) — verified pixel-level offscreen
- Fixed glyph positioning bug (baseline math) caught by isolated test
- Window auto-fits content (adjustSize) — no more oversized clock
- Start at Login: checkable tray item, persisted in QSettings,
  LaunchAgent enable/disable (TDD: roundTrip test caught disable()
  returning false when plist already absent)
- Color dialog: hex/HTML input + 'transparent' + native picker fallback;
  opaque colors stored as #RRGGBB
- Border: glyph outline instead of box border; background still painted
  in paintEvent (QSS doesn't render with WA_TranslucentBackground on macOS)
- Removed window shadow (setHasShadow:NO), no bold, SF Pro Rounded
- Font size dialogs allow up to 200 (was 72)
- macOS: icon template 16pt, light/dark auto-adapt; LaunchAgent points
  to /Applications install
This commit is contained in:
2026-08-19 22:41:33 +03:00
parent 6b9cb32534
commit d9008479c1
9 changed files with 402 additions and 61 deletions
+34 -1
View File
@@ -14,6 +14,15 @@ const QString launchAgentLabel = QStringLiteral("com.clouck.clock");
bool AutoStartManager::enableForCurrentApplication()
{
#ifdef Q_OS_MAC
return enableForPath(QCoreApplication::applicationFilePath());
#else
return false;
#endif
}
bool AutoStartManager::enableForPath(const QString &executablePath)
{
#ifdef Q_OS_MAC
const QString agentPath = launchAgentPath();
if (agentPath.isEmpty())
@@ -33,8 +42,32 @@ bool AutoStartManager::enableForCurrentApplication()
return false;
}
agentFile.write(launchAgentContents(QCoreApplication::applicationFilePath()).toUtf8());
agentFile.write(launchAgentContents(executablePath).toUtf8());
return agentFile.commit();
#else
Q_UNUSED(executablePath);
return false;
#endif
}
bool AutoStartManager::disable()
{
#ifdef Q_OS_MAC
const QString agentPath = launchAgentPath();
if (agentPath.isEmpty() || !QFile::exists(agentPath))
{
return true; // already gone — desired state reached
}
return QFile::remove(agentPath);
#else
return false;
#endif
}
bool AutoStartManager::isEnabled()
{
#ifdef Q_OS_MAC
return QFile::exists(launchAgentPath());
#else
return false;
#endif