Skip to content

Commit b040dd0

Browse files
committed
karm-kira: Removed the mendatory grow in dialogFooter.
1 parent 21ec706 commit b040dd0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/karm-kira/about-dialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export Ui::Child aboutDialog(String name) {
3939
),
4040
}),
4141
dialogFooter({
42+
Ui::grow(NONE),
4243
button([](auto& n) {
4344
showDialog(n, licenseDialog());
4445
},

src/karm-kira/color-input.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ export Ui::Child colorPickerDialog() {
283283
dialogTitleBar("Color Picker"s),
284284
content | Ui::insets({8, 16}),
285285
dialogFooter({
286+
Ui::grow(NONE),
286287
dialogCancel(),
287288
dialogAction(Ui::SINK<>, "Ok"s),
288289
}),

src/karm-kira/dialog.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ export Ui::Child dialogDescription(String text) {
6262

6363
export Ui::Child dialogFooter(Ui::Children children) {
6464
auto isMobile = App::formFactor == App::FormFactor::MOBILE;
65-
if (not isMobile)
66-
children.pushFront(Ui::grow(NONE));
6765
return Ui::flow(
6866
{
6967
isMobile ? Math::Flow::TOP_TO_BOTTOM : Math::Flow::LEFT_TO_RIGHT,
@@ -78,8 +76,8 @@ export Ui::Child dialogFooter(Ui::Children children) {
7876
export Ui::Child dialogAction(Opt<Ui::Send<>> onPress, String text) {
7977
return Ui::button(
8078
[onPress = std::move(onPress)](auto& n) {
81-
onPress(n);
82-
Ui::closeDialog(n);
79+
onPress(n);
80+
Ui::closeDialog(n);
8381
},
8482
Ui::ButtonStyle::primary(),
8583
text
@@ -101,6 +99,7 @@ export Ui::Child alertDialog(String title, String description) {
10199
dialogDescription(description),
102100
}),
103101
dialogFooter({
102+
Ui::grow(NONE),
104103
dialogAction(Ui::SINK<>, "Ok"s),
105104
}),
106105
});

0 commit comments

Comments
 (0)