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
15 changes: 13 additions & 2 deletions QuickCaptureDaemon.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ PluginComponent {
property bool isDownloading: false
property string currentCapturePath: ""
property string captureOutputName: ""
property bool hideControlCenter: pluginData.defaultHideControlCenter !== false
readonly property int captureTimeoutMs: 60000
readonly property int scrollCaptureTimeoutMs: 120000
readonly property bool isAnnotating: modal.shouldBeVisible
Expand Down Expand Up @@ -77,8 +78,17 @@ PluginComponent {
root.isCapturing = true;
root.pendingCaptureAction = finalAction;
root.pendingCaptureMode = finalMode;
root.closeControlCenter();
captureDelayTimer.start();

if (root.hideControlCenter) {
root.closeControlCenter();
captureDelayTimer.start();
} else {
root.startActualCapture();
}
}

function toggleHideControlCenter() {
root.hideControlCenter = !root.hideControlCenter;
}

function closeControlCenter() {
Expand Down Expand Up @@ -221,6 +231,7 @@ PluginComponent {
root.toastError(I18n.tr("Failed to save screenshot"));
});
} else {
root.closeControlCenter();
modal.currentCapturePath = path;
modal.shouldBeVisible = true;
modal.open();
Expand Down
13 changes: 12 additions & 1 deletion QuickCaptureSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,10 @@ PluginSettings {
SectionTitle {
text: I18n.tr("Capture Options")
icon: "settings"
showReset: outputTargetName.isDirty || skipConfirm.isDirty || includeCursor.isDirty || resetLastRegion.isDirty
showReset: outputTargetName.isDirty || defaultHideControlCenter.isDirty || skipConfirm.isDirty || includeCursor.isDirty || resetLastRegion.isDirty
onResetClicked: {
outputTargetName.resetToDefault();
defaultHideControlCenter.resetToDefault();
skipConfirm.resetToDefault();
includeCursor.resetToDefault();
resetLastRegion.resetToDefault();
Expand Down Expand Up @@ -544,6 +545,16 @@ PluginSettings {

Separator {}

ToggleSettingPlus {
id: defaultHideControlCenter
settingKey: "defaultHideControlCenter"
label: I18n.tr("Hide Control Center by Default")
description: I18n.tr("Initial state for the Control Center toggle.")
defaultValue: true
}

Separator {}

ToggleSettingPlus {
id: resetLastRegion
settingKey: "resetLastRegion"
Expand Down
14 changes: 14 additions & 0 deletions QuickCaptureWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,20 @@ PluginComponent {
if (root.daemon) root.daemon.showHistoryCarousel();
}
}

DankActionButton {
iconName: root.daemon && root.daemon.hideControlCenter ? "visibility_off" : "visibility"
buttonSize: 28
iconSize: 16
iconColor: root.daemon && root.daemon.hideControlCenter ? Theme.surfaceVariantText : Theme.primary
tooltipText: root.daemon && root.daemon.hideControlCenter
? I18n.tr("Hide Control Center")
: I18n.tr("Show Control Center")
tooltipSide: "bottom"
onClicked: {
if (root.daemon) root.daemon.toggleHideControlCenter();
}
}
}
}

Expand Down