Skip to content

Commit

Permalink
up 修改主界面
Browse files Browse the repository at this point in the history
  • Loading branch information
Coloryr committed Jul 16, 2024
1 parent 4486497 commit dcd5ca9
Show file tree
Hide file tree
Showing 55 changed files with 806 additions and 665 deletions.
2 changes: 1 addition & 1 deletion src/ColorMC.Core/CoreMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace ColorMC.Core;
public static class ColorMCCore
{
public const string TopVersion = "A27";
public const string DateVersion = "20240715";
public const string DateVersion = "20240716";

/// <summary>
/// 版本号
Expand Down
3 changes: 3 additions & 0 deletions src/ColorMC.Gui/ColorMC.Gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,7 @@
<ProjectReference Include="..\..\X11.Net\X11\X11.csproj" />
<ProjectReference Include="..\ColorMC.Core\ColorMC.Core.csproj" />
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Remove="UI\Controls\Main\MainUserControl.axaml" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions src/ColorMC.Gui/Manager/ThemeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ static ThemeManager()
ProgressBarBG = Brush.Parse("#FFe4e4e7"),
MainGroupBG = Brush.Parse("#FFd4d4d8"),
MainGroupBorder = Brush.Parse("#FFE0E0E0"),
ItemBG = Brush.Parse("#FFFFFFFF"),
ItemBG = Brush.Parse("#CFFFFFFF"),
GameItemBG = Brush.Parse("#FFF2F2F2"),
TopViewBG = Brush.Parse("#886D6D6D"),
AllBorder = Brush.Parse("#FFe5e7eb"),
Expand All @@ -426,15 +426,15 @@ static ThemeManager()
ProgressBarBG = Brush.Parse("#FF3f3f46"),
MainGroupBG = Brush.Parse("#FF27272a"),
MainGroupBorder = Brush.Parse("#FFE0E0E0"),
ItemBG = Brush.Parse("#FF27272a"),
ItemBG = Brush.Parse("#CF27272a"),
GameItemBG = Brush.Parse("#FFc7c7cb"),
TopViewBG = Brush.Parse("#886D6D6D"),
AllBorder = Brush.Parse("#FFe5e7eb"),
ButtonBorder = Brush.Parse("#FFD4D4D8"),
TopBGColor = Brush.Parse("#FFF4F4F5"),
TopGridColor = Brush.Parse("#FF202020"),
OverBGColor = Brush.Parse("#FF000000"),
OverBrushColor = Brush.Parse("#FF1d1d1d")
OverBrushColor = Brush.Parse("#FF1d1d1d"),
};
}
}
6 changes: 5 additions & 1 deletion src/ColorMC.Gui/Manager/WindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public static DownloadArg ShowDownload()
});
}

public static void ShowUser(bool add = false, string? url = null)
public static void ShowUser(bool add = false, bool relogin = false, string? url = null)
{
if (UserWindow != null)
{
Expand All @@ -242,6 +242,10 @@ public static void ShowUser(bool add = false, string? url = null)
{
UserWindow?.Add();
}
if (relogin)
{
UserWindow?.Relogin();
}
}

public static void ShowMain()
Expand Down
3 changes: 1 addition & 2 deletions src/ColorMC.Gui/Resource/Icon/Setting/svg16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/ColorMC.Gui/Resource/Language/gui_zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"MainWindow.Text15": "发现启动器更新!",
"MainWindow.Text16": "立即升级",
"MainWindow.Text17": "更新日志",
"MainWindow.Text18": "映射大厅",
"MainWindow.Text18": "映射大厅 一起联机!",
"MainWindow.Text19": "查看列表",
"MainWindow.Text20": "Minecraft News",
"MainWindow.Text21": "没有News",
Expand Down Expand Up @@ -84,6 +84,7 @@
"MainWindow.Error5": "游戏实例复制失败",
"MainWindow.Error6": "至少登录一个正版账户才能使用映射功能",
"MainWindow.Error7": "未知用户类型",
"MainWindow.Error8": "{0}\n是否要重新登录账户",
"UserWindow.Title": "用户列表",
"UserWindow.DataGrid.Text1": "使用",
"UserWindow.DataGrid.Text3": "账户类型",
Expand Down
5 changes: 5 additions & 0 deletions src/ColorMC.Gui/Style/DataGrid.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@

<Style Selector="DataGrid">
<Setter Property="Foreground" Value="{setting:Theme FontColor}" />
<Style Selector="^ /template/ Rectangle#PART_ColumnHeadersAndRowsSeparator">
<Setter Property="Fill" Value="Transparent" />
</Style>
</Style>

<Style Selector="DataGridColumnHeader">
<Setter Property="Foreground" Value="{setting:Theme FontColor}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="SeparatorBrush" Value="Transparent" />
</Style>

<Style Selector="DataGridRow:selected /template/ Rectangle#BackgroundRectangle">
Expand Down
70 changes: 32 additions & 38 deletions src/ColorMC.Gui/UI/Controls/Add/AddControl.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,24 +213,21 @@
</Panel>
</DockPanel>
</ScrollViewer>
<Panel
Name="VersionDisplay"
Background="{setting:Theme TopViewBG}"
IsVisible="False">
<Decorator Name="VersionDisplay" IsVisible="False">
<Border
Margin="10"
Classes="t3"
Margin="20,10,20,20"
Classes="t2"
DockPanel.Dock="Top">
<DockPanel Margin="15">
<WrapPanel DockPanel.Dock="Top">
<TextBlock Margin="0,0,10,10" Text="{setting:Localize Text.GameVersion}" />
<DockPanel>
<WrapPanel Margin="15,15,15,0" DockPanel.Dock="Top">
<TextBlock Margin="0,0,10,0" Text="{setting:Localize Text.GameVersion}" />
<ComboBox
Width="150"
Margin="0,0,10,10"
Margin="0,0,10,0"
VerticalAlignment="Center"
ItemsSource="{Binding GameVersionList}"
SelectedItem="{Binding GameVersionDownload}" />
<StackPanel Margin="0,0,10,10" Orientation="Horizontal">
<StackPanel Margin="0,0,10,0" Orientation="Horizontal">
<TextBlock Margin="0,0,5,0" Text="{setting:Localize AddModPackWindow.Text5}" />
<NumericUpDown
Width="110"
Expand All @@ -245,7 +242,7 @@
<Button
Width="100"
Height="35"
Margin="-2,-3,3,7"
Margin="-2,-3,3,-3"
Classes="top"
Command="{Binding Refresh1}"
Content="{setting:Localize AddModPackWindow.Text10}"
Expand All @@ -254,7 +251,7 @@
<Button
Width="100"
Height="35"
Margin="-2,-3,3,7"
Margin="-2,-3,3,-3"
Classes="top"
Command="{Binding GoFile}"
Content="{setting:Localize AddModPackWindow.Text12}"
Expand All @@ -264,6 +261,7 @@
</WrapPanel>
<DataGrid
Name="VersionFiles"
Margin="5"
CanUserResizeColumns="True"
ItemsSource="{Binding FileList}"
SelectedItem="{Binding File}">
Expand Down Expand Up @@ -292,25 +290,22 @@
</DataGrid>
</DockPanel>
</Border>
</Panel>
<Panel
Name="OptifineDisplay"
Background="{setting:Theme TopViewBG}"
IsVisible="False">
<Border Margin="10" Classes="t3">
<DockPanel Margin="15">
<WrapPanel DockPanel.Dock="Top">
<TextBlock Margin="0,0,5,10" Text="{setting:Localize Text.GameVersion}" />
</Decorator>
<Decorator Name="OptifineDisplay" IsVisible="False">
<Border Margin="20,10,20,20" Classes="t2">
<DockPanel>
<WrapPanel Margin="15,15,15,0" DockPanel.Dock="Top">
<TextBlock Margin="0,0,5,0" Text="{setting:Localize Text.GameVersion}" />
<ComboBox
Width="150"
Margin="0,0,10,10"
Margin="0,0,10,0"
ItemsSource="{Binding GameVersionList}"
SelectedItem="{Binding GameVersionOptifine}" />
<StackPanel Orientation="Horizontal">
<Button
Width="100"
Height="35"
Margin="-2,-3,3,7"
Margin="-2,-3,3,-3"
Classes="top"
Command="{Binding LoadOptifineList}"
Content="{setting:Localize AddModPackWindow.Text10}"
Expand All @@ -319,7 +314,7 @@
<Button
Width="100"
Height="35"
Margin="-2,-3,3,7"
Margin="-2,-3,3,-3"
Classes="top"
Command="{Binding DownloadOptifine}"
Content="{setting:Localize AddModPackWindow.Text12}"
Expand All @@ -329,6 +324,7 @@
</WrapPanel>
<DataGrid
Name="OptifineFiles"
Margin="5"
CanUserResizeColumns="True"
ItemsSource="{Binding DownloadOptifineList}"
SelectedItem="{Binding OptifineItem}">
Expand All @@ -353,25 +349,22 @@
</DataGrid>
</DockPanel>
</Border>
</Panel>
<Panel
Name="ModDownloadDisplay"
Background="{setting:Theme TopViewBG}"
IsVisible="False">
<Border Margin="10" Classes="t3">
<DockPanel Margin="15">
<WrapPanel DockPanel.Dock="Top">
<TextBlock Margin="0,0,10,10" Text="{setting:Localize AddWindow.Text7}" />
</Decorator>
<Decorator Name="ModDownloadDisplay" IsVisible="False">
<Border Margin="20,10,20,20" Classes="t2">
<DockPanel>
<WrapPanel Margin="15,15,15,0" DockPanel.Dock="Top">
<TextBlock Margin="0,0,20,0" Text="{setting:Localize AddWindow.Text7}" />
<ToggleSwitch
Margin="0,0,10,10"
Margin="0,0,10,0"
IsChecked="{Binding LoadMoreMod}"
OffContent="{setting:Localize AddWindow.Text9}"
OnContent="{setting:Localize AddWindow.Text9}" />
<StackPanel Orientation="Horizontal">
<Button
Width="100"
Height="35"
Margin="-2,-3,3,7"
Margin="-2,-3,3,-3"
Classes="top"
Command="{Binding DownloadAllMod}"
Content="{setting:Localize AddWindow.Text6}"
Expand All @@ -380,7 +373,7 @@
<Button
Width="100"
Height="35"
Margin="-2,-3,3,7"
Margin="-2,-3,3,-3"
Classes="top"
Command="{Binding DownloadMod}"
Content="{setting:Localize AddModPackWindow.Text12}"
Expand All @@ -390,6 +383,7 @@
</WrapPanel>
<DataGrid
Name="ModDownloadFiles"
Margin="5"
CanUserResizeColumns="True"
ItemsSource="{Binding DownloadModList}"
SelectedItem="{Binding Mod}">
Expand All @@ -415,6 +409,6 @@
</DataGrid>
</DockPanel>
</Border>
</Panel>
</Decorator>
</Panel>
</UserControl>
6 changes: 6 additions & 0 deletions src/ColorMC.Gui/UI/Controls/Add/AddControl.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ private void Model_PropertyChanged(object? sender, PropertyChangedEventArgs e)
if (model.OptifineDisplay == true)
{
App.CrossFade300.Start(null, OptifineDisplay);
App.CrossFade300.Start(ScrollViewer1, null);
}
else
{
App.CrossFade300.Start(OptifineDisplay, null);
App.CrossFade300.Start(null, ScrollViewer1);
}
});
}
Expand All @@ -114,10 +116,12 @@ private void Model_PropertyChanged(object? sender, PropertyChangedEventArgs e)
if (model.ModDownloadDisplay == true)
{
App.CrossFade300.Start(null, ModDownloadDisplay);
App.CrossFade300.Start(ScrollViewer1, null);
}
else
{
App.CrossFade300.Start(ModDownloadDisplay, null);
App.CrossFade300.Start(null, ScrollViewer1);
}
});
}
Expand All @@ -128,10 +132,12 @@ private void Model_PropertyChanged(object? sender, PropertyChangedEventArgs e)
if (model.VersionDisplay == true)
{
App.CrossFade300.Start(null, VersionDisplay);
App.CrossFade300.Start(ScrollViewer1, null);
}
else
{
App.CrossFade300.Start(VersionDisplay, null);
App.CrossFade300.Start(null, ScrollViewer1);
}
});
}
Expand Down
3 changes: 2 additions & 1 deletion src/ColorMC.Gui/UI/Controls/Add/AddJavaControl.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@
<Panel>
<DataGrid
Name="JavaFiles"
Margin="15"
Margin="5"
AutoGenerateColumns="False"
CanUserResizeColumns="True"
CanUserSortColumns="False"
IsVisible="{Binding !Display}"
ItemsSource="{Binding JavaList}">
<DataGrid.Columns>
<DataGridTextColumn
Expand Down
26 changes: 12 additions & 14 deletions src/ColorMC.Gui/UI/Controls/Add/AddModPackControl.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,24 +178,21 @@
</Panel>
</DockPanel>
</ScrollViewer>
<Border
Name="ModPackFiles"
Background="{setting:Theme TopViewBG}"
IsVisible="False">
<Decorator Name="ModPackFiles" IsVisible="False">
<Border
Margin="10"
Classes="t3"
Margin="20,10,20,20"
Classes="t2"
DockPanel.Dock="Top">
<DockPanel Margin="15">
<WrapPanel DockPanel.Dock="Top">
<TextBlock Margin="0,0,5,10" Text="{setting:Localize Text.GameVersion}" />
<DockPanel>
<WrapPanel Margin="15,15,15,0" DockPanel.Dock="Top">
<TextBlock Margin="0,0,5,0" Text="{setting:Localize Text.GameVersion}" />
<ComboBox
Width="150"
Margin="0,0,10,10"
Margin="0,0,10,0"
VerticalAlignment="Center"
ItemsSource="{Binding GameVersionList}"
SelectedItem="{Binding GameVersion1}" />
<StackPanel Margin="0,0,10,10" Orientation="Horizontal">
<StackPanel Margin="0,0,10,0" Orientation="Horizontal">
<TextBlock Margin="0,0,5,0" Text="{setting:Localize AddModPackWindow.Text5}" />
<NumericUpDown
Width="110"
Expand All @@ -209,7 +206,7 @@
<Button
Width="100"
Height="35"
Margin="-2,-3,3,7"
Margin="-2,-3,3,-3"
Classes="top"
Command="{Binding Search}"
Content="{setting:Localize AddModPackWindow.Text10}"
Expand All @@ -218,7 +215,7 @@
<Button
Width="100"
Height="35"
Margin="-2,-3,3,7"
Margin="-2,-3,3,-3"
Classes="top"
Command="{Binding Download}"
Content="{setting:Localize AddModPackWindow.Text12}"
Expand All @@ -228,6 +225,7 @@
</WrapPanel>
<DataGrid
Name="PackFiles"
Margin="5"
CanUserResizeColumns="True"
ItemsSource="{Binding FileList}"
SelectedItem="{Binding Item}">
Expand All @@ -252,6 +250,6 @@
</DataGrid>
</DockPanel>
</Border>
</Border>
</Decorator>
</Panel>
</UserControl>
Loading

0 comments on commit dcd5ca9

Please sign in to comment.