mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add size changed event
This commit is contained in:
parent
29b74624c7
commit
4218b636fe
2 changed files with 19 additions and 1 deletions
|
|
@ -746,7 +746,8 @@
|
|||
Drop="LbxAccessLinks_OnDrop"
|
||||
ItemsSource="{Binding Settings.QuickAccessLinks}"
|
||||
Loaded="lbxAccessLinks_Loaded"
|
||||
SelectedItem="{Binding SelectedQuickAccessLink}">
|
||||
SelectedItem="{Binding SelectedQuickAccessLink}"
|
||||
SizeChanged="lbxAccessLinks_SizeChanged">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Width="600" Header="{DynamicResource plugin_explorer_name}">
|
||||
|
|
|
|||
|
|
@ -125,5 +125,22 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
|||
{
|
||||
lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
|
||||
}
|
||||
|
||||
private void lbxAccessLinks_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
if (sender is not ListView listView) return;
|
||||
if (listView.View is not GridView gView) return;
|
||||
|
||||
var workingWidth =
|
||||
listView.ActualWidth - SystemParameters.VerticalScrollBarWidth; // take into account vertical scrollbar
|
||||
|
||||
if (workingWidth <= 0) return;
|
||||
|
||||
var col1 = 0.6;
|
||||
var col2 = 0.4;
|
||||
|
||||
gView.Columns[0].Width = workingWidth * col1;
|
||||
gView.Columns[1].Width = workingWidth * col2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue