summaryrefslogtreecommitdiff
path: root/plugingui/drumkitframecontent.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2019-10-09 18:02:19 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2019-10-09 18:02:19 +0200
commit2d6cbf8a0bb81bfe55a7d4e04d53a704f93c6b2e (patch)
tree80bab0705a6d5aec8569a3ed626a33a6224cf4f0 /plugingui/drumkitframecontent.cc
parent9b7299412d10e68c8aacc5f0debb7c80bf874120 (diff)
Make FileBrowser window always-on-top and try to position it inside the plugin gui window rectangle.
Diffstat (limited to 'plugingui/drumkitframecontent.cc')
-rw-r--r--plugingui/drumkitframecontent.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugingui/drumkitframecontent.cc b/plugingui/drumkitframecontent.cc
index 1da7201..0850ac1 100644
--- a/plugingui/drumkitframecontent.cc
+++ b/plugingui/drumkitframecontent.cc
@@ -168,6 +168,13 @@ void DrumkitframeContent::kitBrowseClick()
CONNECT(&file_browser, fileSelectNotifier,
this, &DrumkitframeContent::selectKitFile);
file_browser.show();
+ Point p{ window()->x() + (int)window()->width() / 2,
+ window()->y() + (int)window()->height() / 2 };
+ auto p0 = window()->translateToScreen(p);
+ auto sz = file_browser.window()->getNativeSize();
+ file_browser.move(p0.x - sz.width / 2,
+ p0.y - sz.height / 2);
+ file_browser.setAlwaysOnTop(true);
}
void DrumkitframeContent::midimapBrowseClick()
@@ -189,6 +196,13 @@ void DrumkitframeContent::midimapBrowseClick()
CONNECT(&file_browser, fileSelectNotifier,
this, &DrumkitframeContent::selectMapFile);
file_browser.show();
+ Point p{ window()->x() + (int)window()->width() / 2,
+ window()->y() + (int)window()->height() / 2 };
+ auto p0 = window()->translateToScreen(p);
+ auto sz = file_browser.window()->getNativeSize();
+ file_browser.move(p0.x - sz.width / 2,
+ p0.y - sz.height / 2);
+ file_browser.setAlwaysOnTop(true);
}
void DrumkitframeContent::defaultPathChanged(const std::string& path)