minors
This commit is contained in:
66
flake.nix
66
flake.nix
@@ -10,31 +10,83 @@
|
|||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
in {
|
|
||||||
|
|
||||||
|
# Robust fallbacks across channels
|
||||||
|
wrapGApps = pkgs.wrapGAppsHook4 or pkgs.wrapGAppsHook;
|
||||||
|
adwaitaTheme = pkgs.gnome.adwaita-icon-theme or pkgs.adwaita-icon-theme;
|
||||||
|
in
|
||||||
|
{
|
||||||
# Main package
|
# Main package
|
||||||
packages.default = pkgs.stdenv.mkDerivation rec {
|
packages.default = pkgs.stdenv.mkDerivation rec {
|
||||||
pname = "minesweeper";
|
pname = "minesweeper";
|
||||||
version = "0.1";
|
version = "0.1";
|
||||||
|
|
||||||
src = self;
|
src = self;
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.meson pkgs.ninja pkgs.pkg-config ];
|
strictDeps = true;
|
||||||
buildInputs = [ pkgs.gtkmm4 pkgs.libsigcxx30 pkgs.glibmm ];
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
meson
|
||||||
|
ninja
|
||||||
|
pkg-config
|
||||||
|
gobject-introspection
|
||||||
|
wrapGApps
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
gtk4
|
||||||
|
gtkmm4
|
||||||
|
glibmm
|
||||||
|
libsigcxx30
|
||||||
|
gdk-pixbuf
|
||||||
|
librsvg # SVG loader
|
||||||
|
gvfs # GIO modules
|
||||||
|
gsettings-desktop-schemas
|
||||||
|
hicolor-icon-theme
|
||||||
|
adwaitaTheme
|
||||||
|
];
|
||||||
|
|
||||||
|
# Ensure we use Nix-provided GIO modules, not host ones
|
||||||
|
preFixup = ''
|
||||||
|
gappsWrapperArgs+=(
|
||||||
|
--set GIO_EXTRA_MODULES ${pkgs.gvfs}/lib/gio/modules
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with pkgs.lib; {
|
meta = with pkgs.lib; {
|
||||||
description = "A simple GTKmm4 Minesweeper game";
|
description = "A simple GTKmm4 Minesweeper game";
|
||||||
homepage = "https://example.org/minesweeper";
|
homepage = "https://example.org/minesweeper";
|
||||||
license = licenses.gpl3Plus;
|
license = licenses.gpl3Plus;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
|
mainProgram = "minesweeper";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# nix run support
|
||||||
|
apps.${system}.default = {
|
||||||
|
type = "app";
|
||||||
|
program = "${self.packages.${system}.default}/bin/minesweeper";
|
||||||
|
};
|
||||||
|
|
||||||
# Dev shell for hacking
|
# Dev shell for hacking
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
nativeBuildInputs = [ pkgs.meson pkgs.ninja pkgs.pkg-config ];
|
nativeBuildInputs = with pkgs; [
|
||||||
buildInputs = [ pkgs.gtkmm4 pkgs.libsigcxx30 pkgs.glibmm ];
|
meson
|
||||||
|
ninja
|
||||||
|
pkg-config
|
||||||
|
gobject-introspection
|
||||||
|
];
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
gtk4
|
||||||
|
gtkmm4
|
||||||
|
glibmm
|
||||||
|
libsigcxx30
|
||||||
|
gdk-pixbuf
|
||||||
|
librsvg
|
||||||
|
gvfs
|
||||||
|
gsettings-desktop-schemas
|
||||||
|
hicolor-icon-theme
|
||||||
|
adwaitaTheme
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ void MainWindow::setupUI()
|
|||||||
{
|
{
|
||||||
// Configure main window
|
// Configure main window
|
||||||
set_title("MineSweeper");
|
set_title("MineSweeper");
|
||||||
set_default_size(400, 400);
|
set_default_size(650, 650);
|
||||||
set_resizable(true);
|
set_resizable(true);
|
||||||
|
|
||||||
// Configure main layout
|
// Configure main layout
|
||||||
@@ -249,14 +249,14 @@ void MainWindow::setupCSSProviders()
|
|||||||
css_provider->load_from_data(
|
css_provider->load_from_data(
|
||||||
"button.cell-button { border-radius: 0; margin: 1px; padding: 0; }"
|
"button.cell-button { border-radius: 0; margin: 1px; padding: 0; }"
|
||||||
".cell-button:checked { background-color: #e0e0e0; }"
|
".cell-button:checked { background-color: #e0e0e0; }"
|
||||||
".label-1 { font-weight: bold; font-size: 1.2em; color: blue; }"
|
".label-1 { font-weight: bold; font-size: 1.1em; color: blue; }"
|
||||||
".label-2 { font-weight: bold; font-size: 1.2em; color: green; }"
|
".label-2 { font-weight: bold; font-size: 1.1em; color: green; }"
|
||||||
".label-3 { font-weight: bold; font-size: 1.2em; color: darkorange; }"
|
".label-3 { font-weight: bold; font-size: 1.1em; color: darkorange; }"
|
||||||
".label-4 { font-weight: bold; font-size: 1.2em; color: purple; }"
|
".label-4 { font-weight: bold; font-size: 1.1em; color: purple; }"
|
||||||
".label-5 { font-weight: bold; font-size: 1.2em; color: red; }"
|
".label-5 { font-weight: bold; font-size: 1.1em; color: red; }"
|
||||||
".label-6 { font-weight: bold; font-size: 1.2em; color: salmon; }"
|
".label-6 { font-weight: bold; font-size: 1.1em; color: salmon; }"
|
||||||
".label-7 { font-weight: bold; font-size: 1.2em; color: turquoise; }"
|
".label-7 { font-weight: bold; font-size: 1.1em; color: turquoise; }"
|
||||||
".label-8 { font-weight: bold; font-size: 1.2em; color: magenta; }"
|
".label-8 { font-weight: bold; font-size: 1.1em; color: magenta; }"
|
||||||
".confetti { opacity: 0.8; }"
|
".confetti { opacity: 0.8; }"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1061,7 +1061,7 @@ void MainWindow::showNameInputDialog(int time)
|
|||||||
showLeaderboard();
|
showLeaderboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog->close();
|
//dialog->close();
|
||||||
|
|
||||||
// Ask if player wants to play again
|
// Ask if player wants to play again
|
||||||
auto newGameDialog = Gtk::make_managed<Gtk::MessageDialog>(
|
auto newGameDialog = Gtk::make_managed<Gtk::MessageDialog>(
|
||||||
|
|||||||
Reference in New Issue
Block a user