Skip to content

Commit 711f300

Browse files
authored
Merge pull request #1361 from kando-menu/feature/refine-settings-css
New General settings dialog
2 parents 27469d6 + 07db821 commit 711f300

44 files changed

Lines changed: 2410 additions & 414 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/images/blossom_large.svg

Lines changed: 1640 additions & 0 deletions
Loading

docs/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ This changelog follows the rules of [Keep a Changelog](http://keepachangelog.com
2121

2222
**Release Date:** TBD
2323

24+
### :tada: Added
25+
26+
- A redesigned General-Settings dialog with a completely new layout. All the options are still there, but they are now organized in categories which should make it easier to navigate through the settings.
27+
2428
### :wrench: Changed
2529

30+
- The styling of the settings dialog has been updated in various places to make it look more modern.
2631
- Updated many dependencies to their latest versions. Feel free to report any issues you encounter!
2732

2833
## [Kando 2.3.0](https://github.com/kando-menu/kando/releases/tag/v2.3.0)

locales/en/translation.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
"wlroots-pointer-get-timeout-default-behavior": "Pointer fallback position",
188188
"center": "Center",
189189
"previously-reported": "Previously reported",
190-
"backup-and-restore": "Backup and Restore",
190+
"backup-and-restore": "Backup & Restore",
191191
"message": "All your menus and Kando's settings are stored in two JSON files which you can also edit, share, or backup. Click [here]({{link}}) to open the directory where the files are stored.",
192192
"backup-menus": "Backup menus.json…",
193193
"backup-settings": "Backup config.json…",
@@ -199,7 +199,13 @@
199199
"reload-sound-theme": "Reload sound theme",
200200
"dev-tools-note": "Kando uses two windows: One for the menu and one for the settings. You can open the development tools to inspect both windows separately.",
201201
"menu-window-dev-tools": "Inspect menu",
202-
"settings-window-dev-tools": "Inspect settings"
202+
"settings-window-dev-tools": "Inspect settings",
203+
"app-settings": "Application Settings",
204+
"interaction-modes": "Interaction Modes",
205+
"input-options": "Input Options",
206+
"learn-interaction-mode": "Learn more about Kando's interaction modes [here]({{link}})!",
207+
"backup-menus-note": "This will backup or restore all your menus at once. This includes all your configured shortcuts, menu layouts, and your menu collections.",
208+
"backup-settings-note": "This will backup or restore Kando's settings, which include all your general settings and your menu-theme configuration."
203209
},
204210
"introduction-dialog": {
205211
"slide1-title": "Kando offers a unique and efficient way for interacting with your computer.",
@@ -282,7 +288,7 @@
282288
"shortcut-info": "This shortcut opens the menu. It must contain one normal key and any number of modifiers such as Ctrl, Alt, or Shift. When recording, you do not have to press all keys at once, you can also press them one after another. This is useful if a shortcut is already bound to another menu!",
283289
"shortcut-label": "Shortcut",
284290
"shortcut-recording": "Press a shortcut…",
285-
"shortcut-id-label": "Shortcut\u00a0ID",
291+
"shortcut-id-label": "Shortcut ID",
286292
"tags-info": "Tags can be used to group menus in menu collections.",
287293
"tags": "Tags",
288294
"quick-select-key-info": "This key allows you to quickly select the menu item.",

src/settings-renderer/components/common/Base64IconPicker.module.scss

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
// SPDX-License-Identifier: MIT
1010

1111
@use '../../variables.scss' as *;
12+
@use '../../mixins.scss' as *;
1213

1314
textarea.picker {
14-
background-color: $widget-normal;
15+
@include text-input;
1516

16-
color: $text-normal;
17-
border: none;
18-
border-radius: 5px;
19-
font-size: inherit;
20-
padding: 5px;
17+
padding: 10px;
2118
margin-top: 8px;
2219

2320
transition: box-shadow 150ms ease;
@@ -26,10 +23,6 @@ textarea.picker {
2623

2724
overflow-x: hidden;
2825

29-
&:hover {
30-
background-color: $widget-normal-hover;
31-
}
32-
3326
&.invalid {
3427
box-shadow: 0 0 15px rgba(255, 64, 64, 1) inset;
3528
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//////////////////////////////////////////////////////////////////////////////////////////
2+
// _ _ ____ _ _ ___ ____ //
3+
// |_/ |__| |\ | | \ | | This file belongs to Kando, the cross-platform //
4+
// | \_ | | | \| |__/ |__| pie menu. Read more on github.com/kando-menu/kando //
5+
// //
6+
//////////////////////////////////////////////////////////////////////////////////////////
7+
8+
// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
9+
// SPDX-License-Identifier: MIT
10+
11+
// Blossom filter opacity for different color schemes
12+
13+
:global(body.systemColors) {
14+
.blossom {
15+
filter: grayscale(80%) opacity(0.2) blur(2px);
16+
}
17+
18+
@media (prefers-color-scheme: dark) {
19+
.blossom {
20+
filter: grayscale(80%) opacity(0.03) blur(2px);
21+
}
22+
}
23+
}
24+
25+
:global(body.lightColors) {
26+
.blossom {
27+
filter: grayscale(80%) opacity(0.2) blur(2px);
28+
}
29+
}
30+
31+
:global(body.darkColors) {
32+
.blossom {
33+
filter: grayscale(80%) opacity(0.03) blur(2px);
34+
}
35+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//////////////////////////////////////////////////////////////////////////////////////////
2+
// _ _ ____ _ _ ___ ____ //
3+
// |_/ |__| |\ | | \ | | This file belongs to Kando, the cross-platform //
4+
// | \_ | | | \| |__/ |__| pie menu. Read more on github.com/kando-menu/kando //
5+
// //
6+
//////////////////////////////////////////////////////////////////////////////////////////
7+
8+
// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
9+
// SPDX-License-Identifier: MIT
10+
11+
import React from 'react';
12+
13+
import * as classes from './Blossom.module.scss';
14+
15+
const blossom = require('../../../../assets/images/blossom_large.svg');
16+
17+
type Props = {
18+
readonly size?: number | string;
19+
readonly cropRight?: number;
20+
readonly cropBottom?: number;
21+
readonly top?: number | string;
22+
readonly left?: number | string;
23+
readonly right?: number | string;
24+
readonly bottom?: number | string;
25+
};
26+
27+
/**
28+
* Blossom component displays a decorative blossom image.
29+
*
30+
* @param props The properties for the blossom component.
31+
* @returns An image element displaying the blossom image.
32+
*/
33+
export default function Blossom(props: Props) {
34+
return (
35+
<img
36+
className={classes.blossom}
37+
src={blossom}
38+
style={{
39+
position: 'absolute',
40+
width: props.size,
41+
height: props.size,
42+
top: props.top,
43+
left: props.left,
44+
right: props.right,
45+
bottom: props.bottom,
46+
objectFit: 'cover',
47+
objectPosition: `${props.cropRight || 0}px ${props.cropBottom || 0}px`,
48+
}}
49+
/>
50+
);
51+
}

src/settings-renderer/components/common/Button.module.scss

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
// SPDX-License-Identifier: MIT
1010

1111
@use '../../variables.scss' as *;
12+
@use '../../mixins.scss' as *;
1213

1314
.button {
15+
@include normal-button;
16+
1417
display: inline-flex;
1518
align-items: center;
1619

17-
color: $text-normal;
18-
border: none;
19-
border-radius: 5px;
2020
font-size: inherit;
2121
white-space: nowrap;
2222
line-height: 1.3rem;
@@ -73,59 +73,20 @@
7373
justify-content: center;
7474
}
7575

76-
.secondary {
77-
background-color: $widget-normal;
78-
79-
&:hover {
80-
background-color: $widget-normal-hover;
81-
}
82-
83-
&.pressed {
84-
background-color: $widget-normal-active;
85-
}
86-
}
87-
88-
.flat {
89-
background-color: transparent;
90-
91-
&:hover {
92-
background-color: $widget-light;
93-
}
76+
.invisible {
77+
@include invisible-button;
9478
}
9579

9680
.tool {
97-
background-color: transparent;
98-
opacity: 0.8;
99-
100-
&:hover {
101-
opacity: 1;
102-
}
81+
@include tool-button;
10382
}
10483

10584
.primary {
106-
background-color: $widget-primary;
107-
108-
&:hover {
109-
background-color: $widget-primary-hover;
110-
}
111-
112-
&.pressed {
113-
background-color: $widget-primary-active;
114-
}
85+
@include primary-button;
11586
}
11687

11788
.floating {
118-
background-color: $widget-normal;
11989
border-radius: 50px;
120-
121-
&:hover {
122-
color: $text-link-hover;
123-
background-color: $widget-normal-hover;
124-
}
125-
126-
&.pressed {
127-
background-color: $widget-normal-active;
128-
}
12990
}
13091

13192
.small {

src/settings-renderer/components/common/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type Props = {
3232
* background when hovered, tool has no background at all. Defaults to 'secondary'.
3333
* Floating has a dark background and more rounded corners.
3434
*/
35-
readonly variant?: 'primary' | 'secondary' | 'flat' | 'tool' | 'floating';
35+
readonly variant?: 'primary' | 'secondary' | 'invisible' | 'tool' | 'floating';
3636

3737
/** Size of the button. Defaults to 'medium'. */
3838
readonly size?: 'small' | 'medium' | 'large';

src/settings-renderer/components/common/Checkbox.module.scss

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,55 @@
1010

1111
@use '../../variables.scss' as *;
1212

13+
// Toggle switch style
1314
.checkbox {
1415
appearance: none;
15-
margin: 0.15em;
16-
17-
background-color: $widget-normal;
18-
width: 1.5em;
19-
height: 1.5em;
20-
border-radius: 50%;
16+
width: 3em;
17+
height: 1.6em;
18+
background: $widget-normal;
19+
border-radius: 0.8em;
20+
position: relative;
21+
transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
22+
box-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.08) inset;
23+
margin: 0;
2124

2225
&::before {
23-
content: '';
24-
display: block;
25-
margin-top: -0.3em;
26-
margin-left: 0.075em;
27-
transform: scale(0);
28-
transition: 120ms transform ease-in-out;
29-
color: $text-link;
30-
font-size: 2em;
26+
content: '';
27+
position: absolute;
28+
left: 0.2em;
29+
top: 0.2em;
30+
width: 1.2em;
31+
height: 1.2em;
32+
background: $window-background;
33+
border-radius: 50%;
34+
box-shadow: 0 0.05em 0.2em rgba(0, 0, 0, 0.1);
35+
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
36+
will-change: transform;
37+
}
38+
39+
&:checked {
40+
background: $text-link;
3141
}
3242

3343
&:checked::before {
34-
transform: scale(1);
44+
transform: translateX(1.4em);
45+
background: $window-background;
3546
}
3647

3748
&:hover {
38-
background-color: $widget-normal-hover;
49+
background: $widget-normal-hover;
50+
}
51+
52+
&:checked:hover {
53+
background: $text-link-hover;
54+
}
55+
56+
&:active::before {
57+
box-shadow: 0 0.1em 0.4em rgba(0, 0, 0, 0.18);
3958
}
4059

41-
&:active {
42-
transform: translateY(1px);
60+
&:disabled {
61+
opacity: 0.5;
62+
cursor: not-allowed;
4363
}
4464
}

src/settings-renderer/components/common/Dropdown.module.scss

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,12 @@
99
// SPDX-License-Identifier: MIT
1010

1111
@use '../../variables.scss' as *;
12+
@use '../../mixins.scss' as *;
1213

1314
.select {
14-
background-color: $widget-normal;
15-
width: 100%;
16-
17-
color: $text-normal;
18-
border: none;
19-
border-radius: 5px;
20-
font-size: inherit;
15+
@include text-input;
2116

22-
padding: 3px;
17+
cursor: default;
2318

24-
&:hover {
25-
background-color: $widget-normal-hover;
26-
}
19+
width: 100%;
2720
}

0 commit comments

Comments
 (0)