-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Replace tab's title ellpsis by a fade-out #358
Comments
Can I work on this issue? |
@yashasvi-goel Yes :) |
I have written the CSS for completing this task. I'm unable to replace the CSS in place of setElideMode(). |
@mgautierfr @jetownfeve21 Any idea? |
This issue 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. |
This issue 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. |
From @asashnov fade-out seems to need to reimplement our own analog of QTabBar so it can worth 10+ hours. I doubt if it really that important Alternatively, we can do a research to see maybe that change will come in new versions of Qt; or file a bug otherwise, hope someone else will implement it Also, I can search if any other open source application have it. Firefox and Chromium doesn't use Qt, but probably there Konquerror in KDE, or some other web-browser or some other Qt-based app have those tabs I looked into the implementation of QTabBar, and didn't see other way as to copy and tune that code |
@asashnov I don't understand why you would need to subclass |
@kelson42 Yes, It would not be a big problem if fadeout applies to the end of the tab. But tab text is aligned to center now, and it is not customizable with UPDATE: on Windows tab text may be aligned left by default, and 'center' on Linux and MacOS. |
@asashnov Can you measure the width of the text and apply conditionaly the fadeout style? |
@kelson42 two things to consider here:
|
We can carry about the selected tab only, by measuring text width and applying the style for long tab titles. But then we can see faded or not labels in the other (non-active) tabs depending on the selected. |
Also, I looked through KDE screenshots in Google Pictures and haven't seen fade-out in tabs (unless it was Google Chrome in a screenshot, not KDE program). |
@asashnov Th fade outapply to the roght of the text widget, there is no way to force its size so it fill the tab container? |
@kelson42 The current style looks like to be applied using relative size:
So 0 is the beginning of text, 0.8 is 20% to the end, and 1 is the end: (in this picture, the right leg of the second A in tab header is faded out). |
@asashnov I'm not sure to fully understand your last comment like an answer to my latest question... An other approach would be to put the fade-out on the cross picture and make the text going behind it |
@kelson42 I'll see if I can expand the text widget to the whole tab header area. |
A style sheet can be applied only to a Widget. There are 'Sub-Controls' and 'Pseudo States' which can restrict the appliance https://doc.qt.io/qt-5/stylesheet-syntax.html The tabs support the https://doc.qt.io/qt-5/stylesheet-reference.html So not possible to select tabs by number (let's say, 3 and 5 with long texts).
Qt documentation also provides several examples on customization QTabBar, https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar KDE Konsole application uses tabs and allows to enter an arbitrary Qt Style Sheet to customize it. But it's not possible to customize individual tabs also: https://docs.kde.org/trunk5/en/applications/konsole/tabbarstylsheet.html PS. But there is a little chance that this kind of selector can be implemented in the code, just not documented. |
This issue 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. |
Rebased, squashed. |
Currently PR #538 is in 'Changes Requested' state, but this status is wrong, I uploaded a new code: I though it may be a known bug in GitHub, but it's not: In GitHub documentation and on the Internet I haven't found any sign that GitHub Pull Request and 'requested changes' can be break by |
Fixes #358 - fade-out instead elide text (trim with...) in tabs
We currently use an ellipsis (
...
) if the title of the tab is to big to fit to the tab. But we should have a fade out instead. Like in the mockup, see:The text was updated successfully, but these errors were encountered: