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
2 changes: 2 additions & 0 deletions App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public partial class App : Application
protected override void OnStartup(StartupEventArgs e)
{
Languages.Apply();
// Software or graphics card: has to be set before anything is drawn.
Rendering.Apply();
// Before any window or dialog exists, so everything is drawn in the chosen theme.
Theme.Apply(Resources);

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

<!-- The "## vX.Y.Z" section is posted to Telegram with the release (.github/scripts/telegram-release.sh): keep it short. -->

## v2.5.1
- إصلاح: عناصر القائمة كانت تختفي تحت الماوس والأزرار تطلع مخططة على بعض كروت الشاشة وتطبيقات التحكم عن بعد
- البرنامج صار يرسم برمجياً افتراضياً، وتقدر ترجع لكرت الشاشة من صفحة «حول»

## v2.5.0
- صفحة «الجوال» جديدة: مواصفات الجوال وحمايته وهو شغّال على أندرويد
- تتعرف على إضافة Fastboot Studio Companion: حالة AVB من البوت لودر وتعارض المودات
Expand Down
2 changes: 1 addition & 1 deletion FastbootEnhance.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<PropertyGroup>
<Version>2.5.0</Version>
<Version>2.5.1</Version>
<AssemblyTitle>Fastboot Studio</AssemblyTitle>
<Product>Fastboot Studio</Product>
<Authors>IFOKNR; LibXZR</Authors>
Expand Down
6 changes: 5 additions & 1 deletion MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@
</Border>
<StackPanel Grid.Column="1" Margin="26,4,0,0">
<TextBlock Text="Fastboot Studio" FontSize="22" FontWeight="SemiBold"/>
<TextBlock Text="v2.5.0" FontFamily="{StaticResource Mono}" Foreground="{StaticResource Dim}" Margin="0,2,0,10"/>
<TextBlock Text="v2.5.1" FontFamily="{StaticResource Mono}" Foreground="{StaticResource Dim}" Margin="0,2,0,10"/>
<TextBlock Style="{StaticResource Note}" Margin="0,0,0,20" Text="{x:Static props:Resources.about_engine}"/>

<TextBlock Style="{StaticResource SectionLabel}" Text="{x:Static props:Resources.about_developer}"/>
Expand Down Expand Up @@ -1506,6 +1506,10 @@
<WrapPanel x:Name="language_buttons"/>
<TextBlock Style="{StaticResource SectionLabel}" Margin="0,8,0,8" Text="{x:Static props:Resources.theme}"/>
<WrapPanel x:Name="theme_buttons"/>
<TextBlock Style="{StaticResource SectionLabel}" Margin="0,8,0,8" Text="{x:Static props:Resources.rendering}"/>
<WrapPanel x:Name="rendering_buttons"/>
<TextBlock Style="{StaticResource Note}" FontSize="11.5" MaxWidth="520" HorizontalAlignment="Left"
Text="{x:Static props:Resources.rendering_note}"/>
</StackPanel>
</Border>
</StackPanel>
Expand Down
37 changes: 36 additions & 1 deletion MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace FastbootEnhance
public partial class MainWindow : Window
{
public static MainWindow THIS;
const string version = "2.5.0";
const string version = "2.5.1";

public MainWindow()
{
Expand Down Expand Up @@ -53,6 +53,7 @@ public MainWindow()
wireLogs();
wireLanguages();
wireThemes();
wireRendering();
RootUI.init();
PhoneUI.init();
TerminalUI.init();
Expand Down Expand Up @@ -152,6 +153,40 @@ void wireThemes()
}
}

/// <summary>Software or graphics card drawing: the one in use is highlighted. Applies on restart.</summary>
void wireRendering()
{
Rendering.Mode[] modes = { Rendering.Mode.Software, Rendering.Mode.Gpu };
string[] names = { Properties.Resources.rendering_software, Properties.Resources.rendering_gpu };
for (int i = 0; i < modes.Length; i++)
{
Rendering.Mode mode = modes[i];
System.Windows.Controls.Button button = new System.Windows.Controls.Button
{
Content = names[i],
Tag = mode.ToString().ToLowerInvariant(),
Padding = new Thickness(14, 5, 14, 5),
Margin = new Thickness(0, 0, 8, 8),
Style = (Style)FindResource(mode == Rendering.Chosen ? "AccentButton" : "GhostButton"),
};
button.Click += delegate
{
if (mode == Rendering.Chosen)
return;
if (FastbootUI.flashing || PayloadUI.extracting)
{
ThemedDialog.Show(Properties.Resources.theme_busy);
return;
}
Rendering.Save(mode);
if (ThemedDialog.Show(Properties.Resources.rendering_restart, Properties.Resources.rendering,
MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.Yes)
App.Restart();
};
rendering_buttons.Children.Add(button);
}
}

static bool looksLikePayload(string path)
{
try
Expand Down
45 changes: 45 additions & 0 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Properties/Resources.ar.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2185,4 +2185,19 @@ adb shell يحتاج أمر بعده، مثل adb shell getprop. وزر إيقا
<data name="phone_reboot_failed" xml:space="preserve">
<value>الجوال ما أعاد التشغيل: {0}</value>
</data>
<data name="rendering" xml:space="preserve">
<value>طريقة الرسم</value>
</data>
<data name="rendering_software" xml:space="preserve">
<value>برمجي (ثابت)</value>
</data>
<data name="rendering_gpu" xml:space="preserve">
<value>كرت الشاشة</value>
</data>
<data name="rendering_note" xml:space="preserve">
<value>الرسم البرمجي يمنع الوميض واختفاء عناصر القائمة والأزرار المخططة اللي تسببها بعض تعريفات كرت الشاشة وتطبيقات التحكم عن بعد.</value>
</data>
<data name="rendering_restart" xml:space="preserve">
<value>طريقة الرسم الجديدة تشتغل بعد إعادة التشغيل. تعيد تشغيل البرنامج الحين؟</value>
</data>
</root>
15 changes: 15 additions & 0 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2185,4 +2185,19 @@ The bootloader must be unlocked. If the phone does not start afterwards, flash t
<data name="phone_reboot_failed" xml:space="preserve">
<value>The phone did not restart: {0}</value>
</data>
<data name="rendering" xml:space="preserve">
<value>Drawing</value>
</data>
<data name="rendering_software" xml:space="preserve">
<value>Software (steady)</value>
</data>
<data name="rendering_gpu" xml:space="preserve">
<value>Graphics card</value>
</data>
<data name="rendering_note" xml:space="preserve">
<value>Software drawing stops the flicker, vanishing menu items and striped buttons that some graphics drivers and remote-desktop apps cause.</value>
</data>
<data name="rendering_restart" xml:space="preserve">
<value>The new drawing mode applies after a restart. Restart Fastboot Studio now?</value>
</data>
</root>
46 changes: 46 additions & 0 deletions Rendering.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
using System.Windows.Interop;
using System.Windows.Media;

namespace FastbootEnhance
{
/// <summary>
/// How WPF draws the app. With the graphics card, some drivers and remote-desktop apps leave
/// parts of the window undrawn: menu items vanish under the mouse and buttons turn into
/// stripes. Drawing in software avoids that and is plenty fast for this app, so it is the
/// default; the graphics card can be chosen on the About page. Applies on restart.
/// </summary>
static class Rendering
{
public enum Mode
{
Software,
Gpu,
}

/// <summary>For automated runs and troubleshooting: overrides the saved choice without touching it.</summary>
const string OverrideVariable = "FASTBOOT_STUDIO_RENDERING";

public static Mode Chosen { get; private set; } = Mode.Software;

public static Mode Parse(string raw)
{
return (raw ?? "").Trim().ToLowerInvariant() == "gpu" ? Mode.Gpu : Mode.Software;
}

/// <summary>Called once, before the first window or dialog.</summary>
public static void Apply()
{
string raw = Environment.GetEnvironmentVariable(OverrideVariable);
if (string.IsNullOrWhiteSpace(raw))
raw = Settings.Get("rendering");
Chosen = Parse(raw);
RenderOptions.ProcessRenderMode = Chosen == Mode.Software ? RenderMode.SoftwareOnly : RenderMode.Default;
}

public static bool Save(Mode mode)
{
return Settings.Set("rendering", mode == Mode.Gpu ? "gpu" : "software");
}
}
}
2 changes: 1 addition & 1 deletion Themes/Styles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@
RenderOptions.BitmapScalingMode="HighQuality"/>
<StackPanel Margin="11,0,0,0" VerticalAlignment="Center">
<TextBlock Text="Fastboot Studio" FontSize="14" FontWeight="SemiBold" Foreground="{StaticResource Text}"/>
<TextBlock Text="v2.5.0" FontSize="11" FontFamily="{StaticResource Mono}" Foreground="{StaticResource Dim}"/>
<TextBlock Text="v2.5.1" FontSize="11" FontFamily="{StaticResource Mono}" Foreground="{StaticResource Dim}"/>
</StackPanel>
</StackPanel>
<Border DockPanel.Dock="Bottom" Background="{StaticResource Well}" BorderBrush="{StaticResource Line}"
Expand Down
Binary file modified docs/screenshots/01-payload-basic-properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/02-payload-partitions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/03-payload-dynamic-partition-metadata.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/04-device-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/05-usb-check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/06-device-basic-properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/07-device-partitions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/08-confirm-erase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/09-create-missing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/10-flash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/11-slot-switch-blocked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/12-critical-confirm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/13-vbmeta-question.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/14-super-space.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/15-super-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/15a-boot-check-init-boot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/15b-boot-check-vendor-boot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/16-boot-once-init-boot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/17-boot-once-started.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/18-backup-fastboot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/19-backup-fastbootd-question.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/20-backup-recovery-booted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/21-backup-files.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/22-backup-partitions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/23-backup-done.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/24-images-empty.png
Binary file modified docs/screenshots/25-images-super.png
Binary file modified docs/screenshots/26-images-extracted.png
Binary file modified docs/screenshots/27-images-details.png
Binary file modified docs/screenshots/28-images-qualcomm-pieces.png
Binary file modified docs/screenshots/28a-images-boot.png
Binary file modified docs/screenshots/29-super-empty.png
Binary file modified docs/screenshots/30-super-imported.png
Binary file modified docs/screenshots/31-super-built.png
Binary file modified docs/screenshots/32-root-patched.png
Binary file modified docs/screenshots/33-root-flashed.png
Binary file modified docs/screenshots/33a-phone.png
Binary file modified docs/screenshots/33b-phone-copied.png
Binary file modified docs/screenshots/33c-phone-no-companion.png
Binary file modified docs/screenshots/34-terminal.png
Binary file modified docs/screenshots/35-logs.png
Binary file modified docs/screenshots/36-about.png
Binary file modified docs/screenshots/ar-01-payload.png
Binary file modified docs/screenshots/ar-02-device.png
Binary file modified docs/screenshots/ar-03-flash.png
Binary file modified docs/screenshots/ar-04-backup-files.png
Binary file modified docs/screenshots/ar-05-backup-partitions.png
Binary file modified docs/screenshots/ar-06-about.png
Binary file modified docs/screenshots/ar-07-dialog.png
Binary file modified docs/screenshots/ar-08-images-super.png
Binary file modified docs/screenshots/ar-09-backup-fastboot.png
Binary file modified docs/screenshots/ar-10-super.png
Binary file modified docs/screenshots/ar-11-phone.png
Binary file modified docs/screenshots/light-01-payload.png
Binary file modified docs/screenshots/light-02-device.png
Binary file modified docs/screenshots/light-03-flash.png
Binary file modified docs/screenshots/light-04-terminal.png
Binary file modified docs/screenshots/light-05-about.png
Binary file modified docs/screenshots/light-06-phone.png