Skip to content

Commit 9f49cc8

Browse files
committed
Fix for preview gradient suddenly becoming a solid color
1 parent 1800ed3 commit 9f49cc8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

tools/lsp/ui/components/widgets/floating-color-picker-widget.slint

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ component BrushTypeSelector {
3030

3131
in-out property <PickerTab> active-tab: PickerTab.color;
3232

33+
changed active-tab => {
34+
WindowManager.hide-color-stop-picker();
35+
}
36+
3337
HorizontalLayout {
3438
padding-left: EditorSizeSettings.small-margin;
3539
alignment: start;
@@ -1135,7 +1139,7 @@ component ColorPicker inherits DraggablePanel {
11351139
callback close <=> t-close.clicked;
11361140

11371141
changed current-color => {
1138-
if widget-mode == WidgetMode.preview {
1142+
if widget-mode == WidgetMode.preview && PickerData.current-brush-kind == BrushKind.solid {
11391143
WindowManager.update-preview-value(Api.color-to-data(root.current-color).text);
11401144
}
11411145
}

tools/lsp/ui/windowglobal.slint

+7
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ export global PickerData {
3535
}
3636
}
3737

38+
changed current-brush-kind => {
39+
if WindowManager.widget-mode == WidgetMode.preview {
40+
WindowManager.update-brush();
41+
}
42+
}
43+
3844
public function set-current-stop-as-color() {
3945
hue = current-gradient-stops[current-stop-index].color.to-hsv().hue;
4046
saturation = current-gradient-stops[current-stop-index].color.to-hsv().saturation;
@@ -158,6 +164,7 @@ export global WindowManager {
158164
}
159165
PickerData.current-brush = property-value.value-brush;
160166
PickerData.current-gradient-stops = property-value.gradient-stops;
167+
PickerData.current-angle = property-value.value-float;
161168
showing-color-picker = true;
162169
}
163170
}

0 commit comments

Comments
 (0)