mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
[PowerRename] Remember last window size and optimize sorting (#27978)
We don't need to sort deeper layers, because they're being enumerated using explorer API and will appear in order anyway
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
class CSettings
|
||||
{
|
||||
public:
|
||||
static constexpr inline int DEFAULT_WINDOW_WIDTH = 1400;
|
||||
static constexpr inline int DEFAULT_WINDOW_HEIGHT = 800;
|
||||
|
||||
CSettings();
|
||||
|
||||
inline bool GetEnabled()
|
||||
@@ -25,6 +28,17 @@ public:
|
||||
Save();
|
||||
}
|
||||
|
||||
inline std::tuple<int, int> GetLastWindowSize() const
|
||||
{
|
||||
return std::make_tuple(settings.lastWindowWidth, settings.lastWindowHeight);
|
||||
}
|
||||
|
||||
inline void UpdateLastWindowSize(const int width, const int height)
|
||||
{
|
||||
settings.lastWindowWidth = std::max(width, DEFAULT_WINDOW_WIDTH);
|
||||
settings.lastWindowHeight = std::max(height, DEFAULT_WINDOW_HEIGHT);
|
||||
}
|
||||
|
||||
inline bool GetShowIconOnMenu() const
|
||||
{
|
||||
return settings.showIconOnMenu;
|
||||
@@ -134,6 +148,8 @@ private:
|
||||
unsigned int flags{ 0 };
|
||||
std::wstring searchText{};
|
||||
std::wstring replaceText{};
|
||||
int lastWindowWidth{ DEFAULT_WINDOW_WIDTH };
|
||||
int lastWindowHeight{ DEFAULT_WINDOW_HEIGHT };
|
||||
};
|
||||
|
||||
void Reload();
|
||||
|
||||
Reference in New Issue
Block a user