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 tabbar issue in OSX #2702

Merged
merged 1 commit into from
Sep 28, 2015
Merged

Fix tabbar issue in OSX #2702

merged 1 commit into from
Sep 28, 2015

Conversation

goanpeca
Copy link
Member

Fixes #2598

Description

I think now the user can switch the tab when clicking, however when moving tabs the displaced tab will retain a weird color until it has been selected again. I am not sure why, but at least this PR will fix the main issue.

@goanpeca
Copy link
Member Author

@blink1073 can you test?

@blink1073
Copy link
Contributor

Nope, it doesn't actually switch tabs, it just highlights them.

@blink1073
Copy link
Contributor

Traceback (most recent call last):
  File "/Users/ssilvester/workspace/spyder-ide/spyderlib/plugins/__init__.py", line 121, in eventFilter
    self.tab_pressed(event)
  File "/Users/ssilvester/workspace/spyder-ide/spyderlib/plugins/__init__.py", line 135, in tab_pressed
    self.dock_tabbar.mousePressEvent(self, event)
TypeError: QTabBar.mousePressEvent(QMouseEvent): argument 1 has unexpected type 'TabFilter'

@goanpeca
Copy link
Member Author

f*ck, I pushed the wrong change give me asec...

@goanpeca
Copy link
Member Author

Ok can you try again @blink1073 ?

@blink1073
Copy link
Contributor

Flawless!

@blink1073
Copy link
Contributor

I see what you mean about the weird color when dragging them around.

@goanpeca
Copy link
Member Author

Ok I have no idea what is the issue with that weird tab...

There is a thing called document mode that can be applied to OSx, @blink1073

Would you mind adding this line in spyderlib/plugins/__init__py

Line 65 or similar (the init method of the TabFilter)

    def __init__(self, dock_tabbar, main):
        QObject.__init__(self)
        self.dock_tabbar = dock_tabbar
        self.main = main
        self.moving = False
        self.from_index = None
        self.to_index = None

        self.dock_tabbar.setDocumentMode(True)   # New line

This will change the overall look and in this mode the problem is no longer there... but it looks different...
http://doc.qt.io/qt-4.8/qtabbar.html#documentMode-prop

@blink1073
Copy link
Contributor

Ha, that "fixes" the issue, at the expense of looking terrible all the time 😄

screen shot 2015-09-21 at 7 27 51 am

@blink1073
Copy link
Contributor

Prob takes a different set of css.

@goanpeca
Copy link
Member Author

Hahahahah yes... I have tried resetting css refreshing, updating... meh...

Well will be a minor hiccup for now,

@ccordoba12 this can be merged I believe

@ccordoba12
Copy link
Member

Thanks for the fix @goanpeca!

One thing about documentMode: activating it makes Spyder crash when you undock panes (at least in Qt 4). That's why we don't use it and instead have a huge qss file to compensate for it :-)

ccordoba12 added a commit that referenced this pull request Sep 28, 2015
@ccordoba12 ccordoba12 merged commit 0e8fb0d into spyder-ide:master Sep 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot change between UI tabs on OSX
3 participants