Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build ALG Welcome - Test Build

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
container: archlinux:latest

steps:
- name: Install dependencies
run: pacman -Syu --noconfirm base-devel cmake qt6-base git

- name: Checkout repository
uses: actions/checkout@v4

- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release

- name: Build
run: cmake --build build -j$(nproc)
4 changes: 4 additions & 0 deletions assets/switch_off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/switch_on.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 19 additions & 2 deletions src/WelcomeWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ WelcomeWindow::WelcomeWindow(QWidget *parent)
: QMainWindow(parent)
, calamaresTimer(std::make_unique<QTimer>())
{
// Setup search paths for assets
QDir::setSearchPaths("assets", {
"/usr/share/alg-welcome/assets",
QDir::currentPath() + "/assets",
QDir::currentPath() + "/../assets" // Support running from build directory
});

// Get system information
desktopEnv = Extras::getDesktopEnvironment();
isLiveISO = Extras::checkIfLiveISO();

// Setup UI
setupWindow();
// applyStylesheet();
applyStylesheet();
setupUI();

// Setup Calamares monitoring
Expand Down Expand Up @@ -250,7 +257,17 @@ QPushButton* WelcomeWindow::createButtonWithIcon(const QString &label,

// Set icon
if (fromFile) {
const QString iconPath = QDir::currentPath() + "/" + iconName;
// Use search path prefix if iconName doesn't already have it
QString iconPath = iconName;
if (!iconPath.startsWith("assets:")) {
// Strip leading 'assets/' if present since we use the 'assets:' search path
if (iconPath.startsWith("assets/")) {
iconPath = "assets:" + iconPath.mid(7);
} else {
iconPath = "assets:" + iconPath;
}
}

if (QFile::exists(iconPath)) {
button->setIcon(QIcon(iconPath));
button->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "WelcomeWindow.h"
#include "version.h"
#include "utils/Autostart.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QDebug>
Expand Down Expand Up @@ -39,6 +40,10 @@ int main(int argc, char *argv[]) {
qDebug() << "ALG Welcome version:" << ALG_WELCOME_VERSION;
}

// Always ensure autostart is enabled so the welcome app
// displays on boot (important for the live ISO)
Autostart::toggleAutostart(true);

WelcomeWindow window;
window.show();

Expand Down
16 changes: 5 additions & 11 deletions styles.qss
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,18 @@ QCheckBox {
}

QCheckBox::indicator {
width: 42px;
height: 22px;
border-radius: 11px;
background-color: #d0d0d0;
border: none;
width: 48px;
height: 24px;
}

QCheckBox::indicator:hover {
background-color: #c0c0c0;
QCheckBox::indicator:unchecked {
image: url(assets:switch_off.svg);
}

QCheckBox::indicator:checked {
background-color: #4a86e8;
image: url(assets:switch_on.svg);
}

QCheckBox::indicator:checked:hover {
background-color: #3a76d8;
}

/* Frame
QFrame {
Expand Down