commit 314ce5e7bcb2f9de04f76e8c0ff6a2bc57eac327
parent 9de88e3817fc901780708b52f99a9104bb699fb9
Author: cfillion <cfillion@users.noreply.github.com>
Date: Thu, 14 Jan 2016 11:24:48 -0800
display modal dialogs at the center of the parent window
Diffstat:
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/dialog.cpp b/src/dialog.cpp
@@ -112,8 +112,6 @@ void Dialog::Destroy(Dialog *dlg)
void Dialog::show()
{
- center();
-
ShowWindow(m_handle, SW_SHOW);
}
@@ -160,6 +158,7 @@ HWND Dialog::getItem(const int idc)
void Dialog::onShow()
{
+ center();
}
void Dialog::onHide()
diff --git a/src/registry.cpp b/src/registry.cpp
@@ -76,10 +76,10 @@ bool Registry::addToREAPER(Version *ver, const Path &root)
if(!src)
return false;
- const int section = 0; // 0 = main section
+ enum { MainSection = 0 };
const string &path = (root + src->targetPath()).join();
- custom_action_register_t ca{section, nullptr, path.c_str()};
+ custom_action_register_t ca{MainSection, nullptr, path.c_str()};
const int id = plugin_register("custom_action", (void *)&ca);
return id > 0;