Skip to content
Merged
40 changes: 17 additions & 23 deletions qml/components/BusyStatus.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,23 @@ Rectangle {
border.color: AppTheme.border
border.width: 1
color: AppTheme.surface
height: 44
radius: 22
height: 32
radius: 16
visible: running
width: Math.max(140, label.contentWidth + 50)
width: Math.max(110, contentRow.width + 24)

// Shadow effect
Rectangle {
anchors.fill: parent
anchors.leftMargin: 2
anchors.topMargin: 2
color: AppTheme.shadowColor
radius: 22
z: -1
}
Row {
id: contentRow

anchors.centerIn: parent
spacing: 12
spacing: 8

// Spinner
Item {
height: 20
width: 20
height: 14
width: 14

RotationAnimator on rotation {
duration: 1000
duration: 800
from: 0
loops: Animation.Infinite
running: root.running
Expand All @@ -43,25 +35,27 @@ Rectangle {

Canvas {
anchors.fill: parent
antialiasing: true
renderTarget: Canvas.Image

onPaint: {
var ctx = getContext("2d");
ctx.reset();
ctx.beginPath();
ctx.arc(10, 10, 8, 0, Math.PI * 1.5);
ctx.lineWidth = 2;
ctx.arc(7, 7, 5.5, 0, Math.PI * 1.5);
ctx.lineWidth = 1.5;
ctx.lineCap = "round";
ctx.strokeStyle = AppTheme.primary;
ctx.stroke();
}
}
}
Text {
id: label

Text {
color: AppTheme.text
font.family: AppTheme.fontFamily
font.pixelSize: AppTheme.fontSizeBody
font.weight: Font.DemiBold
font.pixelSize: AppTheme.fontSizeSmall
font.weight: Font.Medium
text: root.text
verticalAlignment: Text.AlignVCenter
}
Expand Down
3 changes: 2 additions & 1 deletion qml/components/ToolbarButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Basic.Button {
property color hoveredIconColor: defaultIconColor
property bool isActive: false
property string tooltipText: ""
property bool showTooltip: true

Layout.preferredHeight: AppTheme.buttonHeight
Layout.preferredWidth: AppTheme.buttonHeight
Expand All @@ -34,7 +35,7 @@ Basic.Button {
Tooltip {
parent: root
text: root.tooltipText
visible: root.hovered && root.tooltipText !== ""
visible: root.showTooltip && root.hovered && root.tooltipText !== ""
position: Qt.AlignTop
}
}
44 changes: 16 additions & 28 deletions qml/features/capture/LongCapturePreviewWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Window {
if (imgPhysicalW <= 0)
return 150;

let viewW = width - 2; // minus border
let viewW = width;
let ratio = viewW / imgPhysicalW;
let h = currentHeight * ratio;
return Math.max(100, h);
Expand All @@ -37,7 +37,7 @@ Window {

color: "transparent"
flags: Qt.Window | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.Tool
height: Math.min(contentHeight + 2, 600) // Cap at 600px, +2 for border
height: Math.min(contentHeight, 600)

width: 300

Expand All @@ -52,7 +52,7 @@ Window {

// Shadow for depth
Rectangle {
color: AppTheme.shadowHeavy
color: AppTheme.shadowMedium
height: parent.height
radius: AppTheme.radiusLarge
width: parent.width
Expand All @@ -63,8 +63,6 @@ Window {
id: mainRect

anchors.fill: parent
border.color: AppTheme.border
border.width: 1
clip: true
color: AppTheme.surface
radius: AppTheme.radiusLarge
Expand All @@ -83,7 +81,6 @@ Window {
id: previewImg

anchors.fill: parent
anchors.margins: 1
cache: false
// Default to cropping (showing latest content) for better feedback during scroll
fillMode: root.showFull ? Image.PreserveAspectFit : Image.PreserveAspectCrop
Expand All @@ -93,49 +90,39 @@ Window {
sourceSize.width: parent.width * Screen.devicePixelRatio
verticalAlignment: Image.AlignBottom

// Loading / Active State
Item {
anchors.centerIn: parent
height: 48
height: 24
visible: root.currentHeight === 0
width: 48
width: 24

RotationAnimator on rotation {
duration: 1500
duration: 800
from: 0
loops: Animation.Infinite
to: 360
}

// Simple spinner using Rectangles
Rectangle {
border.color: AppTheme.subText
border.width: AppTheme.spacingTiny
color: "transparent"
height: 48
opacity: 0.1
radius: AppTheme.radiusLarge
width: 48
}

// Arc segment (simulated with canvas for clean look)
Canvas {
anchors.fill: parent
antialiasing: true
renderTarget: Canvas.Image

onPaint: {
var ctx = getContext("2d");
ctx.reset();
ctx.beginPath();
ctx.arc(width / 2, height / 2, width / 2 - 2, 0, Math.PI / 1.5);
ctx.lineWidth = AppTheme.spacingTiny;
ctx.arc(12, 12, 9, 0, Math.PI * 1.5);
ctx.lineWidth = 2;
ctx.lineCap = "round";
ctx.strokeStyle = AppTheme.primary;
ctx.stroke();
}
}
}
Text {
anchors.centerIn: parent
anchors.verticalCenterOffset: 40
anchors.verticalCenterOffset: 24
color: AppTheme.subText
font.bold: true
font.pixelSize: 12
Expand All @@ -147,14 +134,15 @@ Window {
// Minimal Floating Badge
Rectangle {
anchors.bottom: parent.bottom
anchors.margins: 6
anchors.margins: 8
anchors.right: parent.right
color: AppTheme.primary
height: 20
height: 24
opacity: 0.9

// Add shadow to badge too
layer.enabled: true
radius: AppTheme.radiusMedium
radius: 12
visible: root.currentHeight > 0
width: badgeTxt.contentWidth + AppTheme.spacingMedium

Expand Down
5 changes: 3 additions & 2 deletions qml/features/capture/LongCaptureToolbarWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ Window {

anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
showTooltips: false
buttons: [[
{
"icon": "qrc:/resources/icons/save.svg",
"text": qsTr("Save"),
"action": "save",
"hoverColor": AppTheme.success
"hoverColor": AppTheme.primary
},
{
"icon": "qrc:/resources/icons/keep.svg",
Expand Down Expand Up @@ -82,4 +83,4 @@ Window {
running: isBusy
text: root.busyText
}
}
}
2 changes: 2 additions & 0 deletions qml/features/capture/components/SelectionToolbar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Rectangle {
id: root

property string activeTool: ""
property bool showTooltips: true
property var buttons: [[
{
"icon": "qrc:/resources/icons/square.svg",
Expand Down Expand Up @@ -144,6 +145,7 @@ Rectangle {
icon.source: modelData.icon
icon.width: 24
isActive: modelData.action === root.activeTool
showTooltip: root.showTooltips
tooltipText: modelData.text

onClicked: {
Expand Down
4 changes: 2 additions & 2 deletions src/core/capture/scroll_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::core::capture::stitcher::{ScrollStitcher, StitchResult};
use crate::core::capture::{get_primary_monitor, get_primary_monitor_scale, perform_crop};
use image::RgbaImage;
use log::{error, info};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::thread;
use std::time::Duration;

Expand All @@ -21,7 +21,7 @@ pub fn start_scroll_capture_thread(x: i32, y: i32, width: i32, height: i32, acti
.spawn(move || {
info!("Scroll capture thread started");
// Small delay to let UI hide if needed
thread::sleep(Duration::from_millis(150));
thread::sleep(Duration::from_millis(250));

let Some(monitor) = get_primary_monitor() else {
error!("No primary monitor found for scroll capture");
Expand Down
Loading