-
-
Notifications
You must be signed in to change notification settings - Fork 125
#454 Allow to move tabs #573
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
Conversation
The current implementation works, but has a bug: Steps to reproduce:
Actual result: Settings tab will be collapsed to the icon |
@asashnov Have put the PR to draft, so i can be polished before review. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
e367deb
to
ad31879
Compare
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.
@asashnov Works almost perfectly to my opinion. Only one point. Can you please make the library tab stick to the left (so effectively forbids to move a tab before)?
a789611
to
bf13cea
Compare
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.
Sticky library tab works perfectly. Thx!
bf13cea
to
c8a87dc
Compare
Have just rebased the branch. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
c8a87dc
to
8f7f326
Compare
The branch rebased on top of current master (d140601), multiple commits squashed to one commit. |
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.
Code is good.
It is matter of taste/style but I prefer to use auto
instead of being explicit on the type of the object.
The same way, I prefer
auto zv = currentZimView();
if (zv) {
return zv->getWebView();
}
return nullptr;
to
if (ZimView *zv = currentZimView())
return zv->getWebView();
return nullptr;
Also, I like to have a PR split is several logical commits (but squash commits fixing errors in previous commits of the same PR)
But I will not block the PR for that.
Code is good and functional.
8f7f326
to
b302215
Compare
Replaced to } else if (ZimView *zv = qobject_cast<ZimView*>(w)) {
ZimView *zv = qobject_cast<ZimView*>(mp_stackedWidget->widget(i)); because pointer type is clearly noted by In other cases we should be clear about what we want to get from a tab: QWidget, WebView or ZimView. Splitted the change to 4 logical commits. |
fec0f8c
to
933491b
Compare
933491b
to
97b5522
Compare
Fixed compilation for all 4 commits after splitting the change. |
@asashnov Would you please rebase on master? |
Fix potential segfault when settings tab is open and closing by zim ID
* the Library tab isn't necessary the first tab; * moving the Library tab is possible, but prohibited in TabBar::onTabMoved() * Tabbar uses qobject_cast<> to recognize tab types instead of previously used settings and library (always 0) tab indexes.
97b5522
to
6fe7e74
Compare
@kelson42 rebased and tested, ready to merge. |
Fixes #454
Public interface of tabbar.h changes:
TabBar Implementation changes:
mp_contentManagerView
propertyAdded Q_OBJECT macros in classes
ContentManagerView
andSettingsManagerView
, otherwise qobject_cast doesn't work (https://wiki.qt.io/Coding_Conventions).