Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the chat widget #1265

Merged
merged 11 commits into from
Aug 16, 2022
Prev Previous commit
Next Next commit
Add a small margin on resizable widgets' active edges
The few extra pixels make grabbing the edges a lot easier, greatly improving
usability.
lmoureaux committed Aug 15, 2022
commit c73cc12c99007ec56e3ed548b0c7ec819af9d90b
19 changes: 18 additions & 1 deletion client/widgetdecorations.cpp
Original file line number Diff line number Diff line change
@@ -174,7 +174,24 @@ void close_widget::notify_parent()
/**
Set resizable flags
*/
void resizable_widget::setResizable(Qt::Edges edges) { resizeFlags = edges; }
void resizable_widget::setResizable(Qt::Edges edges)
{
resizeFlags = edges;
auto margins = QMargins();
if (edges & Qt::LeftEdge) {
margins.setLeft(margin_width);
}
if (edges & Qt::RightEdge) {
margins.setRight(margin_width);
}
if (edges & Qt::TopEdge) {
margins.setTop(margin_width);
}
if (edges & Qt::BottomEdge) {
margins.setBottom(margin_width);
}
setContentsMargins(margins);
}

/**
Get resizable flags of wdiget
1 change: 1 addition & 0 deletions client/widgetdecorations.h
Original file line number Diff line number Diff line change
@@ -75,6 +75,7 @@ class resizable_widget : public fcwidget {
Q_OBJECT

static constexpr int event_width = 25;
static constexpr int margin_width = 3;

signals:
void resized(QRect rect);