Skip to content

Commit

Permalink
Apply theme to all forms, fix controls, bump to 0.6.9
Browse files Browse the repository at this point in the history
- Replaced non-functional controls in GAP rescale/reposition dialog
- Use blue inactive color for PropertyGrid instead of Dark Grey
- Actually fix DPI scaling this time
- Apply theme to right click context menu
  • Loading branch information
ShrineFox committed Sep 6, 2023
1 parent d362b21 commit 5485cb7
Show file tree
Hide file tree
Showing 12 changed files with 214 additions and 222 deletions.
3 changes: 2 additions & 1 deletion GFDStudio/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="SystemDPIAware" />
<add key="DpiAwareness" value="PerMonitorV2" />
<add key="EnableWindowsFormsHighDpiAutoResizing" value="false" />
</System.Windows.Forms.ApplicationConfigurationSection>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Expand Down
3 changes: 2 additions & 1 deletion GFDStudio/GFDStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<Version>0.6.8</Version>
<Version>0.6.9</Version>
<Authors>TGE</Authors>
<Company>TGE</Company>
<ApplicationIcon>app_data\icons\main_icon.ico</ApplicationIcon>
<StartupObject>GFDStudio.Program</StartupObject>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions GFDStudio/GUI/DataViewNodes/DataViewNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using GFDLibrary;
using GFDStudio.DataManagement;
using GFDStudio.FormatModules;
using GFDStudio.GUI.Forms;

namespace GFDStudio.GUI.DataViewNodes
{
Expand Down Expand Up @@ -740,6 +741,7 @@ protected internal void InitializeView( bool force = false )
private void InitializeContextMenuStrip()
{
ContextMenuStrip = new ContextMenuStrip();
ContextMenuStrip.VisibleChanged += CreateEventHandler(ShowContextMenuStrip);

var uncategorizedCustomHandlers = mCustomHandlers.Where( x => x.Menu == null ).ToList();
if ( uncategorizedCustomHandlers.Count > 0 )
Expand Down Expand Up @@ -850,6 +852,12 @@ private void InitializeContextMenuStrip()
}
}

private void ShowContextMenuStrip()
{
Theme.RecursivelySetColor( ContextMenuStrip );
return;
}

//
// Helpers
//
Expand Down
1 change: 1 addition & 0 deletions GFDStudio/GUI/Forms/CreateTextureMapDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public partial class CreateTextureMapDialog : MetroSetForm
public CreateTextureMapDialog()
{
InitializeComponent();
Theme.Apply( this );
}

private void OKButton_Click( object sender, EventArgs e )
Expand Down
4 changes: 2 additions & 2 deletions GFDStudio/GUI/Forms/MainForm.Designer.cs

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

2 changes: 1 addition & 1 deletion GFDStudio/GUI/Forms/MainForm.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ private void handleDarkThemeCheckedChanged( object sender, EventArgs e )
settings.SaveJson( settings );

// Change appearance of form elements
Theme.Apply( this, settings );
Theme.Apply( this );
}
}
}
4 changes: 2 additions & 2 deletions GFDStudio/GUI/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace GFDStudio.GUI.Forms
{
public partial class MainForm : MetroSet_UI.Forms.MetroSetForm
{
public Config settings = new Config();
public static Config settings = new Config();

private static MainForm sInstance;
public static MainForm Instance
Expand Down Expand Up @@ -54,7 +54,7 @@ public MainForm()
InitializeEvents();

settings = settings.LoadJson();
Theme.Apply( this, settings );
Theme.Apply( this );
retainColorValuesToolStripMenuItem.Checked = settings.RetainMaterialColors;
retainTexNameToolStripMenuItem.Checked = settings.RetainTextureNames;
useDarkThemeToolStripMenuItem.Checked = settings.DarkMode;
Expand Down
1 change: 1 addition & 0 deletions GFDStudio/GUI/Forms/ModelConverterOptionsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private void OpenEditPreset( string preset )
public ModelConverterOptionsDialog( bool showSceneOptionsOnly )
{
InitializeComponent();
Theme.Apply( this );
VersionTextBox.Text = $"0x{ResourceVersion.Persona5Dancing:X8}";

if ( showSceneOptionsOnly )
Expand Down
Loading

0 comments on commit 5485cb7

Please sign in to comment.