Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scripts/linux/headless-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# FILES_SANDBOX_SEED (optional script run as "script <sandbox-home>" after the default sample content is created),
# FILES_HEADLESS_WM (optional window manager command to run on the private display, e.g. "kwin_x11"; default none),
# FILES_EXEC (path to a packaged launcher, e.g. Files-x86_64.AppImage or packaging/linux/files; run instead of "dotnet Files.dll"),
# FILES_HEADLESS_XFT_DPI (optional Xft.dpi for the private display, e.g. 144 = 1.5x), UNO_DISPLAY_SCALE_OVERRIDE (passed through),
# FILES_BIN (default src/Files.App/bin/Debug/net10.0-desktop), XVFB_SIZE (default 1600x1000).
set -euo pipefail

Expand Down Expand Up @@ -60,6 +61,10 @@ if [[ -n "${FILES_HEADLESS_WM:-}" ]]; then
sleep 3
fi

# Optional HiDPI test: FILES_HEADLESS_XFT_DPI=120 writes Xft.dpi into the private display's X resources (Uno derives the scale from it);
# UNO_DISPLAY_SCALE_OVERRIDE=1.5 is passed through to the app as is.
[[ -n "${FILES_HEADLESS_XFT_DPI:-}" ]] && echo "Xft.dpi: ${FILES_HEADLESS_XFT_DPI}" | DISPLAY=":$display" xrdb -merge

shot() {
ffmpeg -loglevel error -y -f x11grab -video_size "$size" -i ":$display" -frames:v 1 "$outdir/$1.png"
echo "screenshot: $outdir/$1.png"
Expand Down
5 changes: 5 additions & 0 deletions src/Files.App/Data/Contracts/IAppearanceSettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ public interface IAppearanceSettingsService : IBaseSettingsService, INotifyPrope
/// </summary>
bool ShowToolbar { get; set; }

/// <summary>
/// Gets or sets a value whether the Sort and Layout toolbar buttons show a text label next to the icon.
/// </summary>
bool ShowToolbarSortViewLabels { get; set; }

/// <summary>
/// Gets or sets a value whether the status bar should be displayed.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public static void ShowDriveEjectToast()
var toastContent = new AppNotificationBuilder()
.AddText(Strings.EjectNotificationHeader.GetLocalizedResource())
.AddText(Strings.EjectNotificationBody.GetLocalizedResource())
.SetAttributionText("SettingsAboutAppName".GetLocalizedResource())
#if WINDOWS
.SetAttributionText("Files")
#else
.SetAttributionText(Strings.LinuxAppDisplayName.GetLocalizedResource())
#endif
.BuildNotification();
AppNotificationManager.Default.Show(toastContent);
}
Expand Down
3 changes: 3 additions & 0 deletions src/Files.App/Platforms/Desktop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public static int Main(string[] args)

LaunchArguments = args;

// Uno reads Xft.dpi itself; this covers sessions that only export GDK/Qt scale variables
Files.Platform.Linux.Windowing.DisplayScaleResolver.ApplyToProcess();

// Single instance: D-Bus name (socket fallback). A second launch forwards its arguments to the running instance and exits.
// FILES_NO_SINGLE_INSTANCE=1 skips this (for running several instances side by side while developing).
var noSingleInstance = Environment.GetEnvironmentVariable("FILES_NO_SINGLE_INSTANCE") == "1";
Expand Down
8 changes: 5 additions & 3 deletions src/Files.App/Platforms/Desktop/WindowEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,17 @@ private void AppWindow_Changed(AppWindow sender, AppWindowChangedEventArgs args)
}

/// <summary>
/// Sizes the window to 80% of the primary work area (at most 1280x800 scaled up to 1600x1000 on big screens), centered.
/// Sizes the window to 80% of the primary work area (capped at 1600x1000 logical pixels), centered.
/// </summary>
private void ApplyDefaultSize()
{
try
{
var work = DisplayArea.Primary.WorkArea;
var width = Math.Clamp((int)(work.Width * 0.8), Math.Min(MinWidth, work.Width), 1600);
var height = Math.Clamp((int)(work.Height * 0.8), Math.Min(MinHeight, work.Height), 1000);
// AppWindow sizes are physical pixels; the caps are logical
var scale = Files.Platform.Linux.Windowing.DisplayScaleResolver.GetEffectiveScale();
var width = Math.Clamp((int)(work.Width * 0.8), Math.Min((int)(MinWidth * scale), work.Width), (int)(1600 * scale));
var height = Math.Clamp((int)(work.Height * 0.8), Math.Min((int)(MinHeight * scale), work.Height), (int)(1000 * scale));
AppWindow.Resize(new Windows.Graphics.SizeInt32 { Width = width, Height = height });
AppWindow.Move(new Windows.Graphics.PointInt32 { X = work.X + (work.Width - width) / 2, Y = work.Y + (work.Height - height) / 2 });
}
Expand Down
7 changes: 7 additions & 0 deletions src/Files.App/Services/Settings/AppearanceSettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ public bool ShowToolbar
set => Set(value);
}

/// <inheritdoc/>
public bool ShowToolbarSortViewLabels
{
get => Get(true);
set => Set(value);
}

/// <inheritdoc/>
public bool ShowStatusBar
{
Expand Down
21 changes: 21 additions & 0 deletions src/Files.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -4993,6 +4993,27 @@
<data name="LinuxFileSystemRoot" xml:space="preserve">
<value>File System</value>
</data>
<data name="ToggleSidebarPane" xml:space="preserve">
<value>Toggle sidebar</value>
</data>
<data name="StatusCenterToggleDetails" xml:space="preserve">
<value>Show or hide details</value>
</data>
<data name="ShowToolbarSortViewLabels" xml:space="preserve">
<value>Show labels on the Sort and Layout buttons</value>
</data>
<data name="Error" xml:space="preserve">
<value>Error</value>
</data>
<data name="FolderItemAutomation" xml:space="preserve">
<value>Folder</value>
</data>
<data name="CommitsNumber" xml:space="preserve">
<value>Commits: {0}</value>
</data>
<data name="StatusCenter_PrepareInProgress" xml:space="preserve">
<value>Preparing...</value>
</data>
<data name="LinuxServiceMenuConfirmationText" xml:space="preserve">
<value>This service-menu action will run the command shown below on your selection. Only run actions from sources you trust.</value>
</data>
Expand Down
15 changes: 0 additions & 15 deletions src/Files.App/Strings/fil-PH/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="NewWindow" xml:space="preserve">
<value/>
</data>
<data name="CopyPath" xml:space="preserve">
<value>Kopyahin ang daan</value>
</data>
<data name="CopyItemPath" xml:space="preserve">
<value>Kopyahin ang Path</value>
</data>
<data name="CopyPathWithQuotes" xml:space="preserve">
<value/>
</data>
<data name="CopyItemPathWithQuotes" xml:space="preserve">
<value>Kopyahin ang path ng item kasama ang quotes</value>
</data>
Expand Down Expand Up @@ -168,12 +162,6 @@
<data name="SelectAll" xml:space="preserve">
<value>Piliin lahat</value>
</data>
<data name="InvertSelection" xml:space="preserve">
<value/>
</data>
<data name="ClearSelection" xml:space="preserve">
<value/>
</data>
<data name="PropertiesModified.Text" xml:space="preserve">
<value>Nabago:</value>
</data>
Expand Down Expand Up @@ -309,9 +297,6 @@
<data name="Delete" xml:space="preserve">
<value>Burahin</value>
</data>
<data name="PinFolderToSidebar" xml:space="preserve">
<value/>
</data>
<data name="WelcomeDialogTitle" xml:space="preserve">
<value>Welcome to Files!</value>
</data>
Expand Down
3 changes: 0 additions & 3 deletions src/Files.App/Strings/hi-IN/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@
<data name="CopyItemPath" xml:space="preserve">
<value>Copy item path</value>
</data>
<data name="CopyPathWithQuotes" xml:space="preserve">
<value/>
</data>
<data name="CopyItemPathWithQuotes" xml:space="preserve">
<value>Copy selected item path with quotes</value>
</data>
Expand Down
3 changes: 0 additions & 3 deletions src/Files.App/Strings/id-ID/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3297,9 +3297,6 @@
<data name="OpenProperties" xml:space="preserve">
<value>Properti</value>
</data>
<data name="OpenClassicProperties" xml:space="preserve">
<value/>
</data>
<data name="OpenPropertiesDescription" xml:space="preserve">
<value>Buka jendela properti</value>
</data>
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Styles/ToolbarButtonStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Width" Value="68" />
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin" Value="-3" />
<Setter Property="FocusVisualMargin" Value="0" />
<Setter Property="AllowFocusOnInteraction" Value="False" />
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
<Setter Property="KeyboardAcceleratorPlacementMode" Value="Hidden" />
Expand Down
3 changes: 2 additions & 1 deletion src/Files.App/UserControls/NavigationToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
Height="32"
Padding="0"
x:Load="{x:Bind IsSidebarPaneOpenToggleButtonVisible, Mode=OneWay}"
AutomationProperties.Name="ToggleSidebarPane"
AutomationProperties.Name="{helpers:ResourceString Key=ToggleSidebarPane}"
Background="Transparent"
BorderBrush="Transparent"
Click="SidebarPaneToggleButton_Click"
Expand Down Expand Up @@ -148,6 +148,7 @@

<Button
x:Name="FlyoutButton"
AutomationProperties.Name="{helpers:ResourceString Key=SeeMore}"
LosingFocus="NavigationButtonOverflowFlyoutButton_LosingFocus"
Style="{StaticResource AddressToolbarButtonStyle}"
ToolTipService.ToolTip="{helpers:ResourceString Key=SeeMore}"
Expand Down
1 change: 1 addition & 0 deletions src/Files.App/UserControls/StatusCenter/StatusCenter.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
Height="32"
Padding="0"
x:Load="{x:Bind IsSpeedAndProgressAvailable, Mode=OneWay}"
AutomationProperties.Name="{helpers:ResourceString Key=StatusCenterToggleDetails}"
Background="Transparent"
BorderBrush="Transparent"
IsChecked="{x:Bind IsExpanded, Mode=TwoWay}">
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/UserControls/Toolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
AccessKeyInvoked="AppBarButton_AccessKeyInvoked"
AutomationProperties.Name="{helpers:ResourceString Key=Sort}"
Label="{helpers:ResourceString Key=Sort}"
LabelPosition="Collapsed"
LabelPosition="Default"
Style="{StaticResource ToolBarAppBarButtonFlyoutStyle}"
ToolTipService.ToolTip="{helpers:ResourceString Key=Sort}">

Expand Down Expand Up @@ -271,7 +271,7 @@
AccessKeyInvoked="AppBarButton_AccessKeyInvoked"
AutomationProperties.Name="{helpers:ResourceString Key=Layout}"
Label="{helpers:ResourceString Key=Layout}"
LabelPosition="Collapsed"
LabelPosition="Default"
Style="{StaticResource ToolBarAppBarButtonFlyoutStyle}"
ToolTipService.ToolTip="{helpers:ResourceString Key=Layout}">

Expand Down
13 changes: 13 additions & 0 deletions src/Files.App/UserControls/Toolbar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ private void Toolbar_Loaded(object sender, RoutedEventArgs e)
{
App.AppModel.PropertyChanged += AppModel_PropertyChanged;
foreach (var cmd in Commands) cmd.PropertyChanged += Command_PropertyChanged;
ApplySortViewLabels();
RequestToolbarRefresh(true);
UserSettingsService.AppearanceSettingsService.PropertyChanged += AppearanceSettings_PropertyChanged;
}
Expand Down Expand Up @@ -158,6 +159,18 @@ private void AppearanceSettings_PropertyChanged(object? sender, PropertyChangedE
{
if (e.PropertyName is nameof(IAppearanceSettingsService.CustomToolbarItems))
RequestToolbarRefresh(true);
else if (e.PropertyName is nameof(IAppearanceSettingsService.ShowToolbarSortViewLabels))
DispatcherQueue.TryEnqueue(ApplySortViewLabels);
}

private void ApplySortViewLabels()
{
var position = UserSettingsService.AppearanceSettingsService.ShowToolbarSortViewLabels
? CommandBarLabelPosition.Default
: CommandBarLabelPosition.Collapsed;

ArrangementOptions.LabelPosition = position;
LayoutOptionsButton.LabelPosition = position;
}

private async void EditTagsMenu_TagsChanged(object? sender, EventArgs e)
Expand Down
14 changes: 14 additions & 0 deletions src/Files.App/ViewModels/Settings/AppearanceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,20 @@ public bool ShowToolbar
}
}

public bool ShowToolbarSortViewLabels
{
get => UserSettingsService.AppearanceSettingsService.ShowToolbarSortViewLabels;
set
{
if (value != UserSettingsService.AppearanceSettingsService.ShowToolbarSortViewLabels)
{
UserSettingsService.AppearanceSettingsService.ShowToolbarSortViewLabels = value;

OnPropertyChanged();
}
}
}

public bool ShowStatusBar
{
get => UserSettingsService.AppearanceSettingsService.ShowStatusBar;
Expand Down
6 changes: 6 additions & 0 deletions src/Files.App/Views/Settings/AppearancePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@
IsOn="{x:Bind ViewModel.ShowToolbar, Mode=TwoWay}" />

<wctcontrols:SettingsExpander.Items>
<wctcontrols:SettingsCard Header="{helpers:ResourceString Key=ShowToolbarSortViewLabels}">
<ToggleSwitch
AutomationProperties.AutomationControlType="Custom"
AutomationProperties.Name="{helpers:ResourceString Key=ShowToolbarSortViewLabels}"
IsOn="{x:Bind ViewModel.ShowToolbarSortViewLabels, Mode=TwoWay}" />
</wctcontrols:SettingsCard>
<wctcontrols:SettingsCard
Command="{x:Bind ViewModel.CustomizeToolbarCommand, Mode=OneWay}"
Header="{helpers:ResourceString Key=CustomizeToolbarDescription}"
Expand Down
3 changes: 3 additions & 0 deletions src/Files.Platform.Linux/Native/X11Native.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ internal static unsafe partial class X11Native
[LibraryImport(LibX11)]
public static partial int XCloseDisplay(nint display);

[LibraryImport(LibX11)]
public static partial nint XResourceManagerString(nint display);

[LibraryImport(LibX11)]
public static partial int XConnectionNumber(nint display);

Expand Down
Loading
Loading