Skip to content

Commit

Permalink
Merge pull request #91 from Grabacr07/fix-90
Browse files Browse the repository at this point in the history
fixes #90
  • Loading branch information
Grabacr07 committed Nov 9, 2015
2 parents 61dc340 + 2a7a029 commit 6dc84e7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
3 changes: 2 additions & 1 deletion source/Grabacr07.KanColleViewer/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
z-index:1
}

.area-pickupgame
.area-pickupgame,
.area-menu
{
display:none!important;
}</value>
Expand Down

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

3 changes: 2 additions & 1 deletion source/Grabacr07.KanColleViewer/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
z-index:1
}

.area-pickupgame
.area-pickupgame,
.area-menu
{
display:none!important;
}</Value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace Grabacr07.KanColleViewer.ViewModels.Settings
{
public class UserStyleSheetSettingsViewModel : ViewModel
{
private bool isBackToDefaultValue;

#region UserStyleSheet 変更通知プロパティ

private string _UserStyleSheet;
Expand All @@ -21,6 +23,7 @@ public string UserStyleSheet
get { return this._UserStyleSheet; }
set
{
this.isBackToDefaultValue = false;
if (this._UserStyleSheet != value)
{
this._UserStyleSheet = value;
Expand All @@ -34,13 +37,21 @@ public string UserStyleSheet

public void Initialize()
{
this.Cancel();
GeneralSettings.UserStyleSheet.Subscribe(x => this.UserStyleSheet = x).AddTo(this);

if (!GeneralSettings.UserStyleSheet.Provider.IsLoaded)
GeneralSettings.UserStyleSheet.Provider.Load();
this.isBackToDefaultValue = !GeneralSettings.UserStyleSheet.Provider.TryGetValue(GeneralSettings.UserStyleSheet.Key, out this._UserStyleSheet);
this._UserStyleSheet = GeneralSettings.UserStyleSheet;
this.RaisePropertyChanged(nameof(this.UserStyleSheet));
}

public void Apply()
{
GeneralSettings.UserStyleSheet.Value = this.UserStyleSheet;
if (this.isBackToDefaultValue)
GeneralSettings.UserStyleSheet.Reset();
else
GeneralSettings.UserStyleSheet.Value = this.UserStyleSheet;
}

public void Cancel()
Expand All @@ -51,6 +62,7 @@ public void Cancel()
public void BackToDefaultValue()
{
this.UserStyleSheet = GeneralSettings.UserStyleSheet.Default;
this.isBackToDefaultValue = true;
}
}
}
2 changes: 1 addition & 1 deletion source/MetroTrilithon
Submodule MetroTrilithon updated from 293ad4 to beddfd

0 comments on commit 6dc84e7

Please sign in to comment.