-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Allow WidgetTab to use artwork tabs (@StCyr) #3569
Conversation
This version can only display & manage artwork tabs, which breaks the InstrumentSoundShapingView as it still uses text tabs. I'm planing to improve this implementation to let these artwork tabs fall back to text mode when no artwork is given. This would solve the problem of the InstrumentSoundShapingView.
This version will draw an artwork tab when the TabWidget::addTab function is given a pixmapName. Otherwise, when pixmapName is NULL, it will fall back drawing a text tab.
Atm, tooltips are simply tabs' name.
…e caption 'space.
…ey can now show more meaningfull information then simply the tab's name. 2) Fixed the compilation problem with QT5
…es gdb crash with SIGFPE.
…flat design. Cyrille
The InstrumentTrackWindow's height has been increased by the same amount. Cyrille
…ened design. Cyrille
+ some code cleaning in TabWidgets
This reverts commit 5b162c0. Conflicts: src/gui/widgets/TabWidget.cpp Reason: Artwork's color themeability had the side-effect that it removed the artworks' alpha channel, thus making them ugly.
src/gui/widgets/TabWidget.cpp
Outdated
( *it ).nwidth = tab_width; | ||
|
||
// Get artwork | ||
QPixmap artwork( embed::getIconPixmap( ( *it ).pixmap ) ); |
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.
note to self: whitespace here
Tested and works nicely, not causing errors on usage. |
@LMMS/developers anyone want to review the code on this? Would be appreciated |
include/TabWidget.h
Outdated
QString name; // name for widget | ||
int nwidth; // width of name when painting | ||
QWidget * w; // ptr to widget | ||
const char *pixmap; // artwork for the widget |
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.
Comment can be formatted like the others. :)
@Umcaruje this looks pretty good. I haven't reviewed it for any syntax errors, but the change appears to be quite minor and straightforward despite the number of files. The major change I see is the draw code has moved from resize event to paint event which may have slight performance implications, but the draw routines are greatly simplified as well. Unfortunately I don't have the experience with updating paint routines to know where they should go from a design perspective. |
Well those were @StCyr's changes, and it makes sense to me to draw in the paint event. Anyways I didn't notice any performance impacts and neither did @qnebra from what I've gathered. This looks ready to merge then. Will fix the comment formatting. |
I'll leave this sitting for 24 hours, and merge after that. |
This is the part I'm a bit confused about as it was working before and only being triggered on construction or resize. But the way he made it is more consistent with how we do it today in other classes, so it's only an observation. To that point, calling |
I agree, will look into removing it. |
@tresf done. |
* First version of artwork tabs for the InstrumentTrackWindow. This version can only display & manage artwork tabs, which breaks the InstrumentSoundShapingView as it still uses text tabs. I'm planing to improve this implementation to let these artwork tabs fall back to text mode when no artwork is given. This would solve the problem of the InstrumentSoundShapingView. * Second version of artwork tabs for the InstrumentTrackWindow. This version will draw an artwork tab when the TabWidget::addTab function is given a pixmapName. Otherwise, when pixmapName is NULL, it will fall back drawing a text tab. * Created artwork for the artwork tabs. * 1st PoC for autosizeable artwork tabs. * TabWidget is 20 pixels tall when it's going to display artwork tabs. * Added tooltip support for the TabWidget class. Atm, tooltips are simply tabs' name. * Imported artworks from RebeccaDeField * Reverted to 12px tall TabWidget * Fine tuning for the positioning of artwork tabs: Take into account the caption 'space. * New artwork for the ENV/LFO tab (has now an ADSR-based look) * 1) Tabs in TabWidget class have now a "tooltip" attribute. So that they can now show more meaningfull information then simply the tab's name. 2) Fixed the compilation problem with QT5 * Fine tuning the positioning of highlighted artwork tabs. * Fixed an issue in TabWidget's artwork tabs autosize function that makes gdb crash with SIGFPE. * TabWidget is 17 pixels tall when it's going to display artwork tabs. * Removed underscore prefix for function parameters as coding convention has changed. (Request at https://github.com/LMMS/lmms/pull/2599/files/dccf9f411996c8c866ff1086b65f15020ef08cd9#r61165005) Cyrille * Removed background gradient for TabWidget as LMMS is going to a more flat design. Cyrille * Increased the graphical TabWidget's height by 2 pixels for eye-candy. The InstrumentTrackWindow's height has been increased by the same amount. Cyrille * Removed gradient in GrouBox widgets as LMMS is going for a more flattened design. Cyrille * Made the background of TabWidget themeable Cyrille * The highlighting color for a TabWidget'selected tab is now themeable. * Made TabWidget's Title text and tab text themeable. * Added a darker background to the TabWidget's tab bar. * Further flatened the design of TabWidget * Flatened the design of the GroupBox widget * Fine tuning the placement of TabWidgets' highlighting background + some code cleaning in TabWidgets * Made the TabWidget's title background and borders themeable * TabWidget - Artwork tabs: Do not change the icon color when it is highlighted * TabWidget: Made the artworks' color themeable * Adapted format to follow LMMS coding conventions * Some more blank spaces to tabs translation to comply with LMMS coding standards. * Some more blank spaces to tabs translation to comply with LMMS coding standards. * Revert "TabWidget: Made the artworks' color themeable" This reverts commit 5b162c0. Conflicts: src/gui/widgets/TabWidget.cpp Reason: Artwork's color themeability had the side-effect that it removed the artworks' alpha channel, thus making them ugly. * Made GroupBox's background color themeable * Update background color, only use one set of images * Use name as tooltip, more descriptive names * Update icons and colors * more things * formatting fixes * Remove update() from constructor
* First version of artwork tabs for the InstrumentTrackWindow. This version can only display & manage artwork tabs, which breaks the InstrumentSoundShapingView as it still uses text tabs. I'm planing to improve this implementation to let these artwork tabs fall back to text mode when no artwork is given. This would solve the problem of the InstrumentSoundShapingView. * Second version of artwork tabs for the InstrumentTrackWindow. This version will draw an artwork tab when the TabWidget::addTab function is given a pixmapName. Otherwise, when pixmapName is NULL, it will fall back drawing a text tab. * Created artwork for the artwork tabs. * 1st PoC for autosizeable artwork tabs. * TabWidget is 20 pixels tall when it's going to display artwork tabs. * Added tooltip support for the TabWidget class. Atm, tooltips are simply tabs' name. * Imported artworks from RebeccaDeField * Reverted to 12px tall TabWidget * Fine tuning for the positioning of artwork tabs: Take into account the caption 'space. * New artwork for the ENV/LFO tab (has now an ADSR-based look) * 1) Tabs in TabWidget class have now a "tooltip" attribute. So that they can now show more meaningfull information then simply the tab's name. 2) Fixed the compilation problem with QT5 * Fine tuning the positioning of highlighted artwork tabs. * Fixed an issue in TabWidget's artwork tabs autosize function that makes gdb crash with SIGFPE. * TabWidget is 17 pixels tall when it's going to display artwork tabs. * Removed underscore prefix for function parameters as coding convention has changed. (Request at https://github.com/LMMS/lmms/pull/2599/files/dccf9f411996c8c866ff1086b65f15020ef08cd9#r61165005) Cyrille * Removed background gradient for TabWidget as LMMS is going to a more flat design. Cyrille * Increased the graphical TabWidget's height by 2 pixels for eye-candy. The InstrumentTrackWindow's height has been increased by the same amount. Cyrille * Removed gradient in GrouBox widgets as LMMS is going for a more flattened design. Cyrille * Made the background of TabWidget themeable Cyrille * The highlighting color for a TabWidget'selected tab is now themeable. * Made TabWidget's Title text and tab text themeable. * Added a darker background to the TabWidget's tab bar. * Further flatened the design of TabWidget * Flatened the design of the GroupBox widget * Fine tuning the placement of TabWidgets' highlighting background + some code cleaning in TabWidgets * Made the TabWidget's title background and borders themeable * TabWidget - Artwork tabs: Do not change the icon color when it is highlighted * TabWidget: Made the artworks' color themeable * Adapted format to follow LMMS coding conventions * Some more blank spaces to tabs translation to comply with LMMS coding standards. * Some more blank spaces to tabs translation to comply with LMMS coding standards. * Revert "TabWidget: Made the artworks' color themeable" This reverts commit 5b162c0. Conflicts: src/gui/widgets/TabWidget.cpp Reason: Artwork's color themeability had the side-effect that it removed the artworks' alpha channel, thus making them ugly. * Made GroupBox's background color themeable * Update background color, only use one set of images * Use name as tooltip, more descriptive names * Update icons and colors * more things * formatting fixes * Remove update() from constructor
* First version of artwork tabs for the InstrumentTrackWindow. This version can only display & manage artwork tabs, which breaks the InstrumentSoundShapingView as it still uses text tabs. I'm planing to improve this implementation to let these artwork tabs fall back to text mode when no artwork is given. This would solve the problem of the InstrumentSoundShapingView. * Second version of artwork tabs for the InstrumentTrackWindow. This version will draw an artwork tab when the TabWidget::addTab function is given a pixmapName. Otherwise, when pixmapName is NULL, it will fall back drawing a text tab. * Created artwork for the artwork tabs. * 1st PoC for autosizeable artwork tabs. * TabWidget is 20 pixels tall when it's going to display artwork tabs. * Added tooltip support for the TabWidget class. Atm, tooltips are simply tabs' name. * Imported artworks from RebeccaDeField * Reverted to 12px tall TabWidget * Fine tuning for the positioning of artwork tabs: Take into account the caption 'space. * New artwork for the ENV/LFO tab (has now an ADSR-based look) * 1) Tabs in TabWidget class have now a "tooltip" attribute. So that they can now show more meaningfull information then simply the tab's name. 2) Fixed the compilation problem with QT5 * Fine tuning the positioning of highlighted artwork tabs. * Fixed an issue in TabWidget's artwork tabs autosize function that makes gdb crash with SIGFPE. * TabWidget is 17 pixels tall when it's going to display artwork tabs. * Removed underscore prefix for function parameters as coding convention has changed. (Request at https://github.com/LMMS/lmms/pull/2599/files/dccf9f411996c8c866ff1086b65f15020ef08cd9#r61165005) Cyrille * Removed background gradient for TabWidget as LMMS is going to a more flat design. Cyrille * Increased the graphical TabWidget's height by 2 pixels for eye-candy. The InstrumentTrackWindow's height has been increased by the same amount. Cyrille * Removed gradient in GrouBox widgets as LMMS is going for a more flattened design. Cyrille * Made the background of TabWidget themeable Cyrille * The highlighting color for a TabWidget'selected tab is now themeable. * Made TabWidget's Title text and tab text themeable. * Added a darker background to the TabWidget's tab bar. * Further flatened the design of TabWidget * Flatened the design of the GroupBox widget * Fine tuning the placement of TabWidgets' highlighting background + some code cleaning in TabWidgets * Made the TabWidget's title background and borders themeable * TabWidget - Artwork tabs: Do not change the icon color when it is highlighted * TabWidget: Made the artworks' color themeable * Adapted format to follow LMMS coding conventions * Some more blank spaces to tabs translation to comply with LMMS coding standards. * Some more blank spaces to tabs translation to comply with LMMS coding standards. * Revert "TabWidget: Made the artworks' color themeable" This reverts commit 5b162c0. Conflicts: src/gui/widgets/TabWidget.cpp Reason: Artwork's color themeability had the side-effect that it removed the artworks' alpha channel, thus making them ugly. * Made GroupBox's background color themeable * Update background color, only use one set of images * Use name as tooltip, more descriptive names * Update icons and colors * more things * formatting fixes * Remove update() from constructor
This is an effort to bring #2599 to a closure. The original PR went stale, and most of the work has been done, so it'd be a shame for it to never get implmeneted, as I think it's a nifty feature.
I rebased the original commits to stable-1.2 and will address the remaining issues. I couldn't push to @StCyr's branch cause I don't have access and github didn't have the feature to allow edits form mantainers at the time of that PR.
Here's how it looks now:
I'll be changing the colors shortly. @RebeccaLaVie input appreciated.