-
Notifications
You must be signed in to change notification settings - Fork 41
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
Widget Resizable now support multiple types of resize #1081
Widget Resizable now support multiple types of resize #1081
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two questions from a first look -- will do a more detailed test later on
client/widgetdecorations.cpp
Outdated
if (drag_event != -1) { | ||
// constants of min size | ||
constexpr auto min_width = 20; | ||
constexpr auto min_height = 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not minimumSizeHint
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not
minimumSizeHint
?
thank's, fixed
resizeFlags = flags; | ||
} | ||
|
||
QFlags<resizable_flag> resizable_widget::getResizable() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a docstring. Does it make sense to inline it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a docstring. Does it make sense to inline it?
The fact is that there is no point in doing inline in this place, this function is not called so often.
And as you said earlier, it makes sense to do inline only in header files.
*/ | ||
bool resizable_widget::hasResizable(resizable_flag flag) const | ||
{ | ||
return resizeFlags.testFlag(flag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it could be made inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it could be made inline
Are you talking about the inline specifier?
inline bool resizable_widget::hasResizable(resizable_flag flag) const {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The specifier is mostly ignored by compilers nowadays, but we could help them by moving the implementation to the header. Anyway not a critical issue :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The specifier is mostly ignored by compilers nowadays, but we could help them by moving the implementation to the header. Anyway not a critical issue :)
Yeah
Spotted a strange behavior:
Also found that it's possible to move the chat window out of the screen if the main window is smaller than the screen:
I suggest to prevent moving any edge out of the |
Could also use |
Merging with associated issues. |
Now we can support several types of "resizable" at the same time
Example:
setResizable(resizable_flag::top | resizable_flag::topLeft | resizable_flag::topRight | resizable_flag::bottom | resizable_flag::bottomLeft | resizable_flag::bottomRight | resizable_flag::left | resizable_flag::right);