Skip to content

Improve and simplify drawing of tabs in TabBarPlus#1075

Closed
Ede123 wants to merge 1 commit intonotepad-plus-plus:masterfrom
Ede123:master
Closed

Improve and simplify drawing of tabs in TabBarPlus#1075
Ede123 wants to merge 1 commit intonotepad-plus-plus:masterfrom
Ede123:master

Conversation

@Ede123
Copy link
Copy Markdown
Contributor

@Ede123 Ede123 commented Nov 1, 2015

Changes in this PR:

  • All positions are dynamically calculated relative to the tab rectangle now (i.e. no hardcoded pixel values are used to position icons/text anymore)
  • Match positioning of icons/text in active and inactive tabs (i.e. elements are not "jumping around" anymore upon selection)

I have some more fixes in line, but I first want to make sure the PR will be accepted like this before putting more work into it.

Some specific fixes:

Here are some screenshot for easy comparison of (old ->new) behavior:
old_vertical(old) vertical(new)

old_horizontal(old)
horizontal(new)

When not using the orange top bar for highlighting content of tabs is shifted two pixels to the top when active (standard for Windows tab controls)
horizontal_alt

@Ede123
Copy link
Copy Markdown
Contributor Author

Ede123 commented Nov 2, 2015

Because I forgot to mention before:
This is tested on Windows XP, Windows 7 and Windows 10.
The tabbar behaves consistent on all three OSs

@Croydon
Copy link
Copy Markdown
Contributor

Croydon commented Nov 2, 2015

👍

@cookieboyeli
Copy link
Copy Markdown

Excellent! It's much better looking with a constant position using a highlighted tab.
Without the highlighted tab it's still jumping around... is that impossible to get rid of? It's much cleaner without the highlighting in my opinion. It would be a shame if you couldn't align that option as well.

I think there is still some wasted space between the save icon/close button and edges, even while inactive. The vertical alignment is greatly improved. I don't think it needs tweaking (except to fix the non highlighted version if possible).
How does horizontal look with one pixel less margin on the left and right sides?

@Ede123
Copy link
Copy Markdown
Contributor Author

Ede123 commented Nov 6, 2015

Tabbar height (or width respectively) was not my decision (see 7a25c98). Since it's not subject of this PR let's not digress further - what my patch achieves, though, is that tab height could be adjusted at any point in the future without breaking positioning of elements.

Regarding 2px vertical position change of tabs without top bar highlighting: Read my description! It's intentional to be consistent with native Windows UI styling. While I'm not bound to this specific change, I think it's reasonable.

Anyway let's wait for a response by @donho and/or @milipili first. I assume they have their own preferences and it does not make sense to fine-tune this PR as long as I don't even know if it will be accepted.

- All positions are dynamically calculated relative to the tab rectangle now (i.e. no hardcoded pixel values are used to position icons/text anymore)
- Match positioning of icons/text in active and inactive tabs (i.e. elements are not "jumping around" anymore upon selection)

Some specific fixes:
- Most issues with vertical TabBar are resolved now (it was basically unusable before, for example labels were cut)
- Darkened background of inactive tabs fills the whole tab now (fixes notepad-plus-plus#1011)
- Close button is centered correctly now (fixes notepad-plus-plus#1010)
@donho donho added the accepted label Nov 30, 2015
@donho donho added this to the 6.x milestone Nov 30, 2015
@donho donho closed this in 5b7f900 Nov 30, 2015
@donho
Copy link
Copy Markdown
Member

donho commented Nov 30, 2015

Nice patch! thank you.

@Ede123 Ede123 deleted the master branch November 30, 2015 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tabbar: Darkened area of inactive tabs too small Tabbar: Close button on tabs is displayed off-center

4 participants