making user dialog draggable on windows

This commit is contained in:
fourtf
2018-06-19 19:42:15 +02:00
parent 78b20776a8
commit b2be44bbe7
4 changed files with 49 additions and 19 deletions
+6 -10
View File
@@ -22,7 +22,8 @@ namespace chatterino {
namespace widgets {
UserInfoPopup::UserInfoPopup()
: BaseWindow(nullptr, BaseWindow::Flags(BaseWindow::Frameless | BaseWindow::DeleteOnFocusOut))
: BaseWindow(nullptr, BaseWindow::Flags(BaseWindow::Frameless | BaseWindow::DeleteOnFocusOut |
BaseWindow::FramelessDraggable))
, hack_(new bool)
{
this->setStayInScreenRect(true);
@@ -376,21 +377,16 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget()
addTimeouts("sec", {{"1", 1}});
addTimeouts("min", {
{"1", 1 * 60},
{"5", 5 * 60},
{"10", 10 * 60},
{"1", 1 * 60}, {"5", 5 * 60}, {"10", 10 * 60},
});
addTimeouts("hour", {
{"1", 1 * 60 * 60},
{"4", 4 * 60 * 60},
{"1", 1 * 60 * 60}, {"4", 4 * 60 * 60},
});
addTimeouts("days", {
{"1", 1 * 60 * 60 * 24},
{"3", 3 * 60 * 60 * 24},
{"1", 1 * 60 * 60 * 24}, {"3", 3 * 60 * 60 * 24},
});
addTimeouts("weeks", {
{"1", 1 * 60 * 60 * 24 * 7},
{"2", 2 * 60 * 60 * 24 * 7},
{"1", 1 * 60 * 60 * 24 * 7}, {"2", 2 * 60 * 60 * 24 * 7},
});
addButton(Ban, "ban", getApp()->resources->buttons.ban);