Skip to content

Commit c1c33a8

Browse files
lilyremigiabrliron
authored andcommitted
Refactor UI layout for selected patches listbox.
Improved grid structure by adjusting margins, row definitions, and text wrapping for better readability. Simplified bindings and rearranged buttons to ensure consistent alignment and user experience.
1 parent 8fa137f commit c1c33a8

File tree

1 file changed

+55
-15
lines changed

1 file changed

+55
-15
lines changed

thcrap_configure_v3/Page2_advanced.xaml

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -214,46 +214,86 @@
214214
</ListBox.ItemContainerStyle>
215215
<ListBox.ItemTemplate>
216216
<DataTemplate>
217-
<Grid Background="Transparent">
217+
<Grid Background="Transparent" Margin="0 2 2 2">
218218

219219
<Grid.ColumnDefinitions>
220+
<ColumnDefinition Width="*" />
220221
<ColumnDefinition Width="Auto" />
221222
<ColumnDefinition Width="Auto" />
222-
<ColumnDefinition Width="Auto" />
223-
<ColumnDefinition Width="*" />
224223
</Grid.ColumnDefinitions>
225224

226-
<TextBlock
225+
<Grid.RowDefinitions>
226+
<RowDefinition Height="Auto" />
227+
<RowDefinition Height="Auto" />
228+
</Grid.RowDefinitions>
229+
230+
<TextBlock
227231
Grid.Column="0"
228-
Grid.ColumnSpan="4">
232+
Grid.Row="0"
233+
Grid.RowSpan="2"
234+
Padding="0"
235+
Margin="3,0,0,0"
236+
TextWrapping="Wrap"
237+
MaxWidth="290"
238+
MaxHeight="40"
239+
VerticalAlignment="Stretch"
240+
HorizontalAlignment="Left"
241+
TextTrimming="WordEllipsis">
229242
<TextBlock.Text>
230-
<MultiBinding StringFormat="{}{0} ({1}/{2})">
231-
<Binding Path="SourcePatch.Title" />
232-
<Binding Path="SourcePatch.Repo.Id" />
233-
<Binding Path="SourcePatch.Id" />
234-
</MultiBinding>
243+
<Binding Path="SourcePatch.Title" />
235244
</TextBlock.Text>
236-
</TextBlock>
245+
</TextBlock>
237246

247+
<TextBlock
248+
Grid.Column="1"
249+
Grid.ColumnSpan="2"
250+
Grid.Row="0"
251+
Padding="0"
252+
Margin="0"
253+
VerticalAlignment="Stretch"
254+
HorizontalAlignment="Right">
255+
<TextBlock.Text>
256+
<Binding Path="SourcePatch.Repo.Id" />
257+
</TextBlock.Text>
258+
</TextBlock>
259+
<TextBlock
260+
Grid.Column="1"
261+
Grid.ColumnSpan="2"
262+
Grid.Row="1"
263+
Padding="0"
264+
Margin="0"
265+
VerticalAlignment="Stretch"
266+
HorizontalAlignment="Right"
267+
TextWrapping="NoWrap"
268+
TextTrimming="CharacterEllipsis"
269+
MaxWidth="55">
270+
<TextBlock.Text>
271+
<Binding Path="SourcePatch.Id" />
272+
</TextBlock.Text>
273+
</TextBlock>
238274

239275
<Button Click="SelectedPatchesMoveLeft"
240-
Grid.Column="0"
276+
Grid.Column="1"
277+
Grid.Row="0"
278+
Grid.RowSpan="2"
241279
Tag="{Binding}"
242280
Margin="0"
243281
Style="{StaticResource HoverVisibleButtonStyle}"
244282
Content="🡸">
245283
</Button>
246284
<Button Click="SelectedPatch_MoveUp"
247-
Grid.Column="1"
285+
Grid.Column="2"
286+
Grid.Row="0"
248287
Tag="{Binding}"
249-
Margin="5,0"
288+
Margin="0"
250289
Style="{StaticResource HoverVisibleButtonStyle}"
251290
Content="🡹">
252291
</Button>
253292
<Button Click="SelectedPatch_MoveDown"
254293
Grid.Column="2"
294+
Grid.Row="1"
255295
Tag="{Binding}"
256-
Margin="0,0, 5, 0"
296+
Margin="0"
257297
Style="{StaticResource HoverVisibleButtonStyle}"
258298
Content="🡻">
259299
</Button>

0 commit comments

Comments
 (0)