Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the ProgressIndicator from Slint instead of the self-made one #21

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

tronical
Copy link
Member

This way it is styled in the same way as the surrounding controls (such as the button).

@tronical
Copy link
Member Author

Screen.Recording.2023-09-19.at.15.55.32.mov

Comment on lines -88 to -90
width: parent.width / 2;
x: parent.width - self.width - 6px;
height: parent.height - 6px;
Copy link
Member Author

@tronical tronical Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this positioning be preserved somehow?

Right now element is just placed in the layout and we let the layout decide on the margin/spacing. Kind of easy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the screenshot, the progressbar seems to extand more than the text in both direction. I suppose it would look better if they had the same margin. Maybe you just need to put the ProgressIndicator in a HorizontalBox.
Or the whole thing in a GridBox with visible: condition; instead of if condition:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, will try that.

ui/install.slint Outdated
@@ -5,7 +5,7 @@
import {
ComboBox, VerticalBox, HorizontalBox, GridBox, Button,
LineEdit, ListView, GroupBox, CheckBox
} from "std-widgets.slint";
, ProgressIndicator} from "std-widgets.slint";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the LSP created this terrible formatting?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh yes. I'll make it less terrible :)

Comment on lines -88 to -90
width: parent.width / 2;
x: parent.width - self.width - 6px;
height: parent.height - 6px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the screenshot, the progressbar seems to extand more than the text in both direction. I suppose it would look better if they had the same margin. Maybe you just need to put the ProgressIndicator in a HorizontalBox.
Or the whole thing in a GridBox with visible: condition; instead of if condition:

This way it is styled in the same way as the surrounding controls (such as the button).
@tronical
Copy link
Member Author

Looks indeed better with margins. I couldn't get GridBox to work because the first Row with the Text elements has conditionals that aren't supported. This seems indeed easier.

Screen.Recording.2023-09-19.at.16.45.39.mov

Copy link
Member

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't get GridBox to work because the first Row with the Text elements has conditionals that aren't supported.

hence my suggestion to use visible instead. But visible:false leave some padding in the layout that is not ideal. The HorizontalBox is clean enough.

@tronical tronical merged commit 10f77c9 into master Sep 20, 2023
2 checks passed
@tronical tronical deleted the simon/progressbar branch September 20, 2023 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants