Skip to content

Commit

Permalink
Forntend.Maui: workaround for button width on Gtk
Browse files Browse the repository at this point in the history
Implemented workaround for incorrect width of some buttons on
Gtk (which were stretched to window width) by introducing
3 columns to grids in ReceivePage and SendPage. Buttons are
placed in central column, while other grid children span all
3 columns.
  • Loading branch information
webwarrior-ws committed Jun 27, 2024
1 parent b713aed commit 25ea1cd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/GWallet.Frontend.XF/ReceivePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,44 @@
xmlns:zxcm="clr-namespace:ZXing.Common;assembly=zxing">
<Grid x:Name="mainLayout"
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto"
ColumnDefinitions="*,Auto,*"
Padding="10,10,10,10"
VerticalOptions="Center"
HorizontalOptions="Center"
>
<Label x:Name="balanceLabel"
Text="..."
HorizontalOptions="Center"
Grid.Row="0"
Grid.ColumnSpan="3"
/>
<Image
x:Name="currencyImage"
IsVisible="false"
Grid.Row="1"
Grid.ColumnSpan="3"
/>
<Label x:Name="fiatBalanceLabel"
Text="..."
HorizontalOptions="Center"
Grid.Row="2"
Grid.ColumnSpan="3"
/>
<Button x:Name="paymentButton"
Text="..."
IsEnabled="false"
HorizontalOptions="Center"
Clicked="OnSendPaymentClicked"
Grid.Row="3"
Grid.Column="1"
/>
<Button x:Name="copyToClipboardButton"
Text="Copy address to clipboard"
IsEnabled="true"
HorizontalOptions="Center"
Clicked="OnCopyToClipboardClicked"
Grid.Row="4"
Grid.Column="1"
/>
<zx:ZXingBarcodeImageView
x:Name="qrCode"
Expand All @@ -46,7 +53,8 @@
WidthRequest="200"
HeightRequest="200"
Grid.Row="5"
>
Grid.ColumnSpan="3"
>
</zx:ZXingBarcodeImageView>
<Button
x:Name="viewTransactionHistoryButton"
Expand All @@ -55,6 +63,7 @@
HorizontalOptions="Center"
Clicked="OnViewTransactionHistoryClicked"
Grid.Row="6"
/>
Grid.Column="1"
/>
</Grid>
</ContentPage>
10 changes: 10 additions & 0 deletions src/GWallet.Frontend.XF/SendPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
HorizontalOptions="FillAndExpand"
RowSpacing="0"
RowDefinitions="Auto,Auto,*,Auto,*,Auto,*,Auto,Auto"
ColumnDefinitions="*,Auto,*"
>
<StackLayout x:Name="transactionLayout"
Orientation="Horizontal"
HorizontalOptions="FillAndExpand"
IsVisible="false"
Grid.Row="0"
Grid.ColumnSpan="3"
>
<Label x:Name="transactionLabel"
Text="Transaction proposal:"
Expand Down Expand Up @@ -41,11 +43,13 @@
TextChanged="OnTransactionEntryTextChanged"
IsVisible="false"
Grid.Row="1"
Grid.ColumnSpan="3"
/>

<StackLayout Orientation="Horizontal"
HorizontalOptions="FillAndExpand"
Grid.Row="2"
Grid.ColumnSpan="3"
>
<Label Text="Destination address:"
HorizontalOptions="Start"
Expand Down Expand Up @@ -73,12 +77,14 @@
IsSpellCheckEnabled="false"
IsTextPredictionEnabled="false"
Grid.Row="3"
Grid.ColumnSpan="3"
/>

<Grid ColumnDefinitions="Auto,*,Auto"
HorizontalOptions="FillAndExpand"
Padding="0,10,0,0"
Grid.Row="4"
Grid.ColumnSpan="3"
>
<Label Text="Amount:"
HorizontalOptions="Start"
Expand Down Expand Up @@ -114,6 +120,7 @@
<Grid x:Name="amountToSendLayout"
HorizontalOptions="FillAndExpand"
Grid.Row="5"
Grid.ColumnSpan="3"
>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
Expand All @@ -137,6 +144,7 @@
<Grid
RowDefinitions="*,Auto"
Grid.Row="6"
Grid.ColumnSpan="3"
>
<Label
x:Name="passwordLabel"
Expand All @@ -157,13 +165,15 @@
HorizontalOptions="Center"
Clicked="OnSendOrSignButtonClicked"
Grid.Row="7"
Grid.Column="1"
/>
<Button x:Name="cancelButton"
Text="Cancel"
IsEnabled="true"
HorizontalOptions="Center"
Clicked="OnCancelButtonClicked"
Grid.Row="8"
Grid.Column="1"
/>
</Grid>
</ContentPage>

0 comments on commit 25ea1cd

Please sign in to comment.