Screenshot settings + ss search
This commit is contained in:
+19
-1
@@ -23,6 +23,7 @@ Singleton {
|
|||||||
property alias osd: adapter.osd
|
property alias osd: adapter.osd
|
||||||
property alias overview: adapter.overview
|
property alias overview: adapter.overview
|
||||||
property bool recentlySaved: false
|
property bool recentlySaved: false
|
||||||
|
property alias screenshot: adapter.screenshot
|
||||||
property alias services: adapter.services
|
property alias services: adapter.services
|
||||||
property alias sidebar: adapter.sidebar
|
property alias sidebar: adapter.sidebar
|
||||||
property alias utilities: adapter.utilities
|
property alias utilities: adapter.utilities
|
||||||
@@ -128,7 +129,8 @@ Singleton {
|
|||||||
background: serializeBackground(),
|
background: serializeBackground(),
|
||||||
launcher: serializeLauncher(),
|
launcher: serializeLauncher(),
|
||||||
colors: serializeColors(),
|
colors: serializeColors(),
|
||||||
dock: serializeDock()
|
dock: serializeDock(),
|
||||||
|
screenshot: serializeScreenshot()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,6 +277,20 @@ Singleton {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serializeScreenshot(): var {
|
||||||
|
return {
|
||||||
|
enable_pp: screenshot.enable_pp,
|
||||||
|
mode: screenshot.mode,
|
||||||
|
corner_radius: screenshot.corner_radius,
|
||||||
|
drop_shadow: screenshot.drop_shadow,
|
||||||
|
rounded_corners: screenshot.rounded_corners,
|
||||||
|
shadow_blur_radius: screenshot.shadow_blur_radius,
|
||||||
|
shadow_color: screenshot.shadow_color,
|
||||||
|
shadow_offset_x: screenshot.shadow_offset_x,
|
||||||
|
shadow_offset_y: screenshot.shadow_offset_y
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function serializeServices(): var {
|
function serializeServices(): var {
|
||||||
return {
|
return {
|
||||||
weatherLocation: services.weatherLocation,
|
weatherLocation: services.weatherLocation,
|
||||||
@@ -430,6 +446,8 @@ Singleton {
|
|||||||
}
|
}
|
||||||
property Overview overview: Overview {
|
property Overview overview: Overview {
|
||||||
}
|
}
|
||||||
|
property Screenshot screenshot: Screenshot {
|
||||||
|
}
|
||||||
property Services services: Services {
|
property Services services: Services {
|
||||||
}
|
}
|
||||||
property SidebarConfig sidebar: SidebarConfig {
|
property SidebarConfig sidebar: SidebarConfig {
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import Quickshell.Io
|
||||||
|
|
||||||
|
JsonObject {
|
||||||
|
property real corner_radius: 12.0
|
||||||
|
property bool drop_shadow: true
|
||||||
|
property bool enable_pp: true
|
||||||
|
property string mode: "manual"
|
||||||
|
property bool rounded_corners: false
|
||||||
|
property real shadow_blur_radius: 22.0
|
||||||
|
property list<int> shadow_color: [0, 0, 0, 160]
|
||||||
|
property real shadow_offset_x: 5.0
|
||||||
|
property real shadow_offset_y: 5.0
|
||||||
|
}
|
||||||
+2
-1
@@ -66,7 +66,8 @@ MouseArea {
|
|||||||
|
|
||||||
function save(): void {
|
function save(): void {
|
||||||
const tmpfile = Qt.resolvedUrl(`/tmp/zshell-picker-${Quickshell.processId}-${Date.now()}.png`);
|
const tmpfile = Qt.resolvedUrl(`/tmp/zshell-picker-${Quickshell.processId}-${Date.now()}.png`);
|
||||||
ZShellIo.saveItem(screencopy, tmpfile, Qt.rect(Math.ceil(rsx), Math.ceil(rsy), Math.floor(sw), Math.floor(sh)), path => Quickshell.execDetached([Quickshell.shellDir + "/scripts/rs-pictures", path]));
|
const cmd = Config.screenshot.enable_pp ? [Quickshell.shellDir + "/scripts/rs-pictures"] : ["swappy", "-f"];
|
||||||
|
ZShellIo.saveItem(screencopy, tmpfile, Qt.rect(Math.ceil(rsx), Math.ceil(rsy), Math.floor(sw), Math.floor(sh)), path => Quickshell.execDetached([...cmd, path]));
|
||||||
closeAnim.start();
|
closeAnim.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,12 @@ Item {
|
|||||||
key: "launcher"
|
key: "launcher"
|
||||||
name: "Launcher"
|
name: "Launcher"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ListElement {
|
||||||
|
icon: "screenshot_region"
|
||||||
|
key: "screenshot"
|
||||||
|
name: "Screenshot"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomClippingRect {
|
CustomClippingRect {
|
||||||
|
|||||||
@@ -0,0 +1,130 @@
|
|||||||
|
import qs.Modules.Settings.Controls
|
||||||
|
import qs.Config
|
||||||
|
import qs.Components
|
||||||
|
|
||||||
|
SettingsPage {
|
||||||
|
SettingsSection {
|
||||||
|
sectionId: "Screenshot"
|
||||||
|
|
||||||
|
SettingsHeader {
|
||||||
|
name: "Screenshot"
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingSwitch {
|
||||||
|
name: "Enable effects"
|
||||||
|
object: Config.screenshot
|
||||||
|
setting: "enable_pp"
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomSplitButtonRow {
|
||||||
|
// active: true
|
||||||
|
label: qsTr("Effects mode")
|
||||||
|
|
||||||
|
menuItems: [
|
||||||
|
MenuItem {
|
||||||
|
icon: "build"
|
||||||
|
text: qsTr("Manual")
|
||||||
|
value: "manual"
|
||||||
|
},
|
||||||
|
MenuItem {
|
||||||
|
icon: "rotate_auto"
|
||||||
|
text: qsTr("Auto")
|
||||||
|
value: "auto"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
onSelected: item => {
|
||||||
|
Config.screenshot.mode = item.value;
|
||||||
|
Config.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingSpinBox {
|
||||||
|
min: 0
|
||||||
|
name: "Corner radius"
|
||||||
|
object: Config.screenshot
|
||||||
|
setting: "corner_radius"
|
||||||
|
step: 1
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingSwitch {
|
||||||
|
name: "Enable drop shadow"
|
||||||
|
object: Config.screenshot
|
||||||
|
setting: "drop_shadow"
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingSwitch {
|
||||||
|
name: "Enable rounded corners"
|
||||||
|
object: Config.screenshot
|
||||||
|
setting: "rounded_corners"
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingSpinBox {
|
||||||
|
min: 0
|
||||||
|
name: "Shadow blur radius"
|
||||||
|
object: Config.screenshot
|
||||||
|
setting: "shadow_blur_radius"
|
||||||
|
step: 1
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingSwitch {
|
||||||
|
name: "Shadow color broken atm"
|
||||||
|
object: Config.Screenshot
|
||||||
|
setting: "shadow_color"
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingSpinBox {
|
||||||
|
min: 0
|
||||||
|
name: "Shadow offset X"
|
||||||
|
object: Config.screenshot
|
||||||
|
setting: "shadow_offset_x"
|
||||||
|
step: 1
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingSpinBox {
|
||||||
|
min: 0
|
||||||
|
name: "Shadow offset Y"
|
||||||
|
object: Config.screenshot
|
||||||
|
setting: "shadow_offset_y"
|
||||||
|
step: 1
|
||||||
|
visible: Config.screenshot.mode === "manual"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -74,6 +74,8 @@ Item {
|
|||||||
stack.push(osd);
|
stack.push(osd);
|
||||||
else if (currentCategory === "launcher")
|
else if (currentCategory === "launcher")
|
||||||
stack.push(launcher);
|
stack.push(launcher);
|
||||||
|
else if (currentCategory === "screenshot")
|
||||||
|
stack.push(screenshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
target: root
|
target: root
|
||||||
@@ -225,4 +227,11 @@ Item {
|
|||||||
Cat.Launcher {
|
Cat.Launcher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: screenshot
|
||||||
|
|
||||||
|
Cat.Screenshot {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -951,6 +951,72 @@ export const settingsIndex = [
|
|||||||
keywords: ["size", "osd", "height"],
|
keywords: ["size", "osd", "height"],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// SCREENSHOT CATEGORY
|
||||||
|
// Screenshot section
|
||||||
|
{
|
||||||
|
name: "Enable effects",
|
||||||
|
category: "screenshot",
|
||||||
|
categoryName: "Screenshot",
|
||||||
|
section: "Screenshot",
|
||||||
|
keywords: ["effects", "shadow", "screenshot"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Effects mode",
|
||||||
|
category: "screenshot",
|
||||||
|
categoryName: "Screenshot",
|
||||||
|
section: "Screenshot",
|
||||||
|
keywords: ["effects", "mode"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Corner radius",
|
||||||
|
category: "screenshot",
|
||||||
|
categoryName: "Screenshot",
|
||||||
|
section: "Screenshot",
|
||||||
|
keywords: ["corner", "radius"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Enable drop shadow",
|
||||||
|
category: "screenshot",
|
||||||
|
categoryName: "Screenshot",
|
||||||
|
section: "Screenshot",
|
||||||
|
keywords: ["drop", "shadow"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Enable rounded corners",
|
||||||
|
category: "screenshot",
|
||||||
|
categoryName: "Screenshot",
|
||||||
|
section: "Screenshot",
|
||||||
|
keywords: ["rounded", "corners"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Shadow blur radius",
|
||||||
|
category: "screenshot",
|
||||||
|
categoryName: "Screenshot",
|
||||||
|
section: "Screenshot",
|
||||||
|
keywords: ["blur", "shadow", "radius"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Shadow color",
|
||||||
|
category: "screenshot",
|
||||||
|
categoryName: "Screenshot",
|
||||||
|
section: "Screenshot",
|
||||||
|
keywords: ["color", "shadow"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Shadow offset X",
|
||||||
|
category: "screenshot",
|
||||||
|
categoryName: "Screenshot",
|
||||||
|
section: "Screenshot",
|
||||||
|
keywords: ["offset", "shadow"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Shadow offset Y",
|
||||||
|
category: "screenshot",
|
||||||
|
categoryName: "Screenshot",
|
||||||
|
section: "Screenshot",
|
||||||
|
keywords: ["offset", "shadow"],
|
||||||
|
},
|
||||||
|
|
||||||
// LAUNCHER CATEGORY
|
// LAUNCHER CATEGORY
|
||||||
// Launcher section
|
// Launcher section
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user