update screenshots and add screenshot mode

This commit is contained in:
2024-06-01 01:12:10 +02:00
parent 78088fd86a
commit 2f286697d6
7 changed files with 77 additions and 11 deletions

View File

@@ -0,0 +1,55 @@
{
"id" : "org.kuchelmeister.ToolboxTuner.Screenshot",
"runtime" : "org.gnome.Platform",
"runtime-version" : "46",
"sdk" : "org.gnome.Sdk",
"sdk-extensions" : [
"org.freedesktop.Sdk.Extension.rust-stable",
"org.freedesktop.Sdk.Extension.llvm15"
],
"command" : "toolbox-tuner",
"finish-args" : [
"--talk-name=org.freedesktop.Flatpak",
"--socket=fallback-x11",
"--socket=wayland",
"--device=dri",
"--env=RUST_LOG=toolbxtuner=debug",
"--env=G_MESSAGES_DEBUG=none",
"--env=RUST_BACKTRACE=1",
"--share=ipc"
],
"build-options" : {
"append-path" : "/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm15/bin",
"prepend-ld-library-path" : "/usr/lib/sdk/llvm15/lib",
"build-args" : [
"--share=network"
],
"env" : {
"CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER" : "clang",
"CARGO_REGISTRIES_CRATES_IO_PROTOCOL" : "sparse",
"CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS" : "-C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold",
"CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER" : "clang",
"CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS" : "-C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold"
},
"test-args" : [
"--socket=x11",
"--share=network"
]
},
"modules" : [
{
"name" : "toolbox-tuner",
"buildsystem" : "meson",
"run-tests" : true,
"sources" : [
{
"type" : "dir",
"path" : "../"
}
],
"config-opts" : [
"-Dprofile=screenshot"
]
}
]
}

View File

@@ -12,11 +12,11 @@
<screenshots> <screenshots>
<screenshot type="default"> <screenshot type="default">
<caption>Main application window showing multiple toolboxes</caption> <caption>Main application window showing multiple toolboxes</caption>
<image type="source" width="1200" height="800">https://media.githubusercontent.com/media/13hannes11/toolbox-tuner/main/data/resources/screenshots/main_light.png</image> <image type="source" width="900" height="600">https://media.githubusercontent.com/media/13hannes11/toolbox-tuner/main/data/resources/screenshots/main_light.png</image>
</screenshot> </screenshot>
<screenshot> <screenshot>
<caption>Main application window in dark mode</caption> <caption>Main application window in dark mode</caption>
<image type="source" width="1200" height="800">https://github.com/13hannes11/toolbox-tuner/blob/main/data/resources/screenshots/main_dark.png</image> <image type="source" width="900" height="600">https://github.com/13hannes11/toolbox-tuner/blob/main/data/resources/screenshots/main_dark.png</image>
</screenshot> </screenshot>
</screenshots> </screenshots>
<branding> <branding>

Binary file not shown.

Binary file not shown.

View File

@@ -42,6 +42,10 @@ if get_option('profile') == 'development'
version_suffix = '-@0@'.format(vcs_tag) version_suffix = '-@0@'.format(vcs_tag)
endif endif
application_id = '@0@.@1@'.format(base_id, profile) application_id = '@0@.@1@'.format(base_id, profile)
elif get_option('profile') == 'screenshot'
profile = 'Screenshot'
version_suffix = ''
application_id = base_id
else else
profile = '' profile = ''
version_suffix = '' version_suffix = ''

View File

@@ -3,7 +3,8 @@ option(
type: 'combo', type: 'combo',
choices: [ choices: [
'default', 'default',
'development' 'development',
'screenshot',
], ],
value: 'default', value: 'default',
description: 'The build profile for Toolbox Tuner. One of "default" or "development".' description: 'The build profile for Toolbox Tuner. One of "default" or "development".'

View File

@@ -262,17 +262,23 @@ impl AppWidgets {
let settings = gio::Settings::new(APP_ID); let settings = gio::Settings::new(APP_ID);
let (width, height) = self.main_window.default_size(); let (width, height) = self.main_window.default_size();
if PROFILE != "Screenshot" {
settings.set_int("window-width", width)?; settings.set_int("window-width", width)?;
settings.set_int("window-height", height)?; settings.set_int("window-height", height)?;
settings.set_boolean("is-maximized", self.main_window.is_maximized())?; settings.set_boolean("is-maximized", self.main_window.is_maximized())?;
}
Ok(()) Ok(())
} }
fn load_window_size(&self) { fn load_window_size(&self) {
let settings = gio::Settings::new(APP_ID); let settings = gio::Settings::new(APP_ID);
if PROFILE == "Screenshot" {
self.main_window.set_default_size(778, 478);
return;
}
let width = settings.int("window-width"); let width = settings.int("window-width");
let height = settings.int("window-height"); let height = settings.int("window-height");
let is_maximized = settings.boolean("is-maximized"); let is_maximized = settings.boolean("is-maximized");