-
Notifications
You must be signed in to change notification settings - Fork 624
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
live-preview: Sort selection popup by area of elements
This is an alternate mode in the selection popup, click on the button next to the search bar to activate.
- Loading branch information
Showing
6 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Copyright © SixtyFPS GmbH <[email protected]> | ||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 | ||
|
||
import { ListView, Palette, ScrollView, LineEdit } from "std-widgets.slint"; | ||
import { ListView, Palette, ScrollView, LineEdit, Button } from "std-widgets.slint"; | ||
import { EditorFontSettings, EditorSizeSettings, EditorSpaceSettings, EditorPalette } from "./styling.slint"; | ||
import { Api, SelectionStackFrame } from "../api.slint"; | ||
import { Icons } from "styling.slint"; | ||
|
@@ -171,14 +171,20 @@ component PopupInner inherits Rectangle { | |
self.focus(); | ||
} | ||
} | ||
|
||
sort-by-area-button := Button { | ||
checkable: true; | ||
icon: Icons.list-filter; | ||
colorize-icon: true; | ||
} | ||
} | ||
|
||
ScrollView { | ||
height: (root.visible-frames * root.frame-height); | ||
|
||
list-view := VerticalLayout { | ||
|
||
for frame[index] in Api.filter-sort-selection-stack(root.selection-stack, filter-edit.text): frame-rect := Rectangle { | ||
for frame[index] in Api.filter-sort-selection-stack(root.selection-stack, filter-edit.text, sort-by-area-button.checked): frame-rect := Rectangle { | ||
height: root.frame-height; | ||
|
||
function frame-color(frame: SelectionStackFrame) -> brush { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters