[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:
Andrey Nekrasov
2023-08-14 21:43:31 +02:00
committed by GitHub
parent 1d35263e4a
commit 7ab2717b09
8 changed files with 53 additions and 3 deletions

View File

@@ -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();