mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
auto update value string in index setter
This commit is contained in:
parent
a70b9fcb2d
commit
8159b6edf1
1 changed files with 33 additions and 15 deletions
|
|
@ -55,7 +55,7 @@ namespace Flow.Launcher.ViewModel
|
||||||
// TODO: CurrentCulture may equal to settings.language when this is constructed
|
// TODO: CurrentCulture may equal to settings.language when this is constructed
|
||||||
TimeFormatDisplayList = TimeFormatList.Select(x => DateTime.Now.ToString(x, CultureInfo.CurrentCulture)).ToList();
|
TimeFormatDisplayList = TimeFormatList.Select(x => DateTime.Now.ToString(x, CultureInfo.CurrentCulture)).ToList();
|
||||||
DateFormatDisplayList = DateFormatList.Select(x => DateTime.Now.ToString(x, CultureInfo.CurrentCulture)).ToList();
|
DateFormatDisplayList = DateFormatList.Select(x => DateTime.Now.ToString(x, CultureInfo.CurrentCulture)).ToList();
|
||||||
UpdateSettingsDateTimeFormat(); // just in case something wrong
|
//UpdateSettingsDateTimeFormat(); // just in case something wrong
|
||||||
}
|
}
|
||||||
|
|
||||||
public Settings Settings { get; set; }
|
public Settings Settings { get; set; }
|
||||||
|
|
@ -310,11 +310,11 @@ namespace Flow.Launcher.ViewModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IList<PluginStoreItemViewModel> LabelMaker(IList<UserPlugin> list)
|
private IList<PluginStoreItemViewModel> LabelMaker(IList<UserPlugin> list)
|
||||||
{
|
{
|
||||||
return list.Select(p=>new PluginStoreItemViewModel(p))
|
return list.Select(p => new PluginStoreItemViewModel(p))
|
||||||
.OrderByDescending(p => p.Category == PluginStoreItemViewModel.NewRelease)
|
.OrderByDescending(p => p.Category == PluginStoreItemViewModel.NewRelease)
|
||||||
.ThenByDescending(p=>p.Category == PluginStoreItemViewModel.RecentlyUpdated)
|
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.RecentlyUpdated)
|
||||||
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.None)
|
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.None)
|
||||||
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.Installed)
|
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.Installed)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
@ -476,9 +476,27 @@ namespace Flow.Launcher.ViewModel
|
||||||
"dd', 'MMMM"
|
"dd', 'MMMM"
|
||||||
};
|
};
|
||||||
|
|
||||||
public int TimeFormatIndex { get; set; } = 0;
|
private int timeFormatIndex = 0;
|
||||||
|
public int TimeFormatIndex
|
||||||
|
{
|
||||||
|
get => timeFormatIndex;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
timeFormatIndex = value;
|
||||||
|
Settings.TimeFormat = TimeFormatList[TimeFormatIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int DateFormatIndex { get; set; } = 0;
|
private int dateFormatIndex = 0;
|
||||||
|
public int DateFormatIndex
|
||||||
|
{
|
||||||
|
get => dateFormatIndex;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
dateFormatIndex = value;
|
||||||
|
Settings.DateFormat = DateFormatList[DateFormatIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public List<string> TimeFormatDisplayList { get; set; } = null;
|
public List<string> TimeFormatDisplayList { get; set; } = null;
|
||||||
|
|
||||||
|
|
@ -505,7 +523,7 @@ namespace Flow.Launcher.ViewModel
|
||||||
DateFormatDisplayList[i] = DateTime.Now.ToString(DateFormatList[i], CultureInfo.CurrentCulture);
|
DateFormatDisplayList[i] = DateTime.Now.ToString(DateFormatList[i], CultureInfo.CurrentCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateSettingsDateTimeFormat();
|
//UpdateSettingsDateTimeFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double WindowWidthSize
|
public double WindowWidthSize
|
||||||
|
|
@ -823,7 +841,7 @@ namespace Flow.Launcher.ViewModel
|
||||||
var dirInfo = new DirectoryInfo(Path.Combine(DataLocation.DataDirectory(), Constant.Logs, Constant.Version));
|
var dirInfo = new DirectoryInfo(Path.Combine(DataLocation.DataDirectory(), Constant.Logs, Constant.Version));
|
||||||
long size = dirInfo.EnumerateFiles("*", SearchOption.AllDirectories).Sum(file => file.Length);
|
long size = dirInfo.EnumerateFiles("*", SearchOption.AllDirectories).Sum(file => file.Length);
|
||||||
|
|
||||||
return _translater.GetTranslation("clearlogfolder") + " (" + FormatBytes(size) + ")" ;
|
return _translater.GetTranslation("clearlogfolder") + " (" + FormatBytes(size) + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue