- 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
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
#include "autostart_manager.h"
|
|
|
|
#include <QTemporaryDir>
|
|
#include <QtTest>
|
|
|
|
class AutoStartManagerTest : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
private slots:
|
|
void createsRunAtLoadLaunchAgent();
|
|
void roundTripsPlistRoundTrip();
|
|
};
|
|
|
|
void AutoStartManagerTest::createsRunAtLoadLaunchAgent()
|
|
{
|
|
const QString executablePath = "/Applications/Clouck.app/Contents/MacOS/Clouck";
|
|
const QString contents = AutoStartManager::launchAgentContents(executablePath);
|
|
|
|
QVERIFY(contents.contains("<key>ProgramArguments</key>"));
|
|
QVERIFY(contents.contains(executablePath));
|
|
QVERIFY(contents.contains("<key>RunAtLoad</key>"));
|
|
QVERIFY(contents.contains("<true/>"));
|
|
}
|
|
|
|
void AutoStartManagerTest::roundTripsPlistRoundTrip()
|
|
{
|
|
// Disabled-by-default: no plist written when enable is false,
|
|
// enableForPath + disable must leave no residue.
|
|
QTemporaryDir home;
|
|
QVERIFY(home.isValid());
|
|
qputenv("HOME", home.path().toUtf8());
|
|
|
|
QVERIFY(AutoStartManager::disable());
|
|
QVERIFY(!QFile::exists(AutoStartManager::launchAgentPath()));
|
|
QVERIFY(!AutoStartManager::isEnabled());
|
|
|
|
QVERIFY(AutoStartManager::enableForPath("/Applications/Clouck.app/Contents/MacOS/Clouck"));
|
|
QVERIFY(AutoStartManager::isEnabled());
|
|
QVERIFY(QFile::exists(AutoStartManager::launchAgentPath()));
|
|
|
|
QVERIFY(AutoStartManager::disable());
|
|
QVERIFY(!AutoStartManager::isEnabled());
|
|
}
|
|
|
|
QTEST_APPLESS_MAIN(AutoStartManagerTest)
|
|
|
|
#include "autostart_manager_test.moc"
|