Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ecb258f
First version of artwork tabs for the InstrumentTrackWindow.
Feb 12, 2016
91872f1
Second version of artwork tabs for the InstrumentTrackWindow.
Feb 16, 2016
e2e8369
Created artwork for the artwork tabs.
Feb 18, 2016
5dcc169
1st PoC for autosizeable artwork tabs.
Feb 21, 2016
46f1ef7
TabWidget is 20 pixels tall when it's going to display artwork tabs.
Feb 21, 2016
f91c3a7
Added tooltip support for the TabWidget class.
Feb 22, 2016
8790021
Imported artworks from RebeccaDeField
Feb 22, 2016
ccc1c55
Reverted to 12px tall TabWidget
Feb 22, 2016
a280816
Fine tuning for the positioning of artwork tabs: Take into account th…
Feb 22, 2016
21a1dfd
New artwork for the ENV/LFO tab (has now an ADSR-based look)
Feb 25, 2016
2b1923b
1) Tabs in TabWidget class have now a "tooltip" attribute. So that th…
Feb 25, 2016
9e1de4d
Fine tuning the positioning of highlighted artwork tabs.
Feb 25, 2016
71761f2
Fixed an issue in TabWidget's artwork tabs autosize function that mak…
Feb 25, 2016
e309f22
TabWidget is 17 pixels tall when it's going to display artwork tabs.
Feb 26, 2016
a9de81d
Removed underscore prefix for function parameters as coding conventio…
Apr 27, 2016
81a3fe0
Removed background gradient for TabWidget as LMMS is going to a more …
Apr 27, 2016
483f03f
Increased the graphical TabWidget's height by 2 pixels for eye-candy.
Apr 29, 2016
b4e2a4b
Removed gradient in GrouBox widgets as LMMS is going for a more flatt…
Apr 29, 2016
c52033c
Made the background of TabWidget themeable
May 12, 2016
2651622
The highlighting color for a TabWidget'selected tab is now themeable.
May 12, 2016
fd9e38b
Made TabWidget's Title text and tab text themeable.
May 13, 2016
eb97167
Added a darker background to the TabWidget's tab bar.
May 13, 2016
ad795d0
Further flatened the design of TabWidget
May 13, 2016
757d4c0
Flatened the design of the GroupBox widget
May 13, 2016
ef392b2
Fine tuning the placement of TabWidgets' highlighting background
May 19, 2016
70c8eda
Made the TabWidget's title background and borders themeable
May 19, 2016
ab66556
TabWidget - Artwork tabs: Do not change the icon color when it is hig…
May 19, 2016
9f4df3f
TabWidget: Made the artworks' color themeable
May 20, 2016
b16a087
Adapted format to follow LMMS coding conventions
Jul 15, 2016
b75c89d
Some more blank spaces to tabs translation to comply with LMMS coding…
Jul 27, 2016
1d57917
Some more blank spaces to tabs translation to comply with LMMS coding…
Aug 2, 2016
d280afa
Revert "TabWidget: Made the artworks' color themeable"
Sep 5, 2016
9b34722
Made GroupBox's background color themeable
Sep 5, 2016
f9f60d4
Update background color, only use one set of images
Umcaruje May 21, 2017
217a39b
Use name as tooltip, more descriptive names
Umcaruje May 21, 2017
cbf14df
Update icons and colors
Umcaruje May 21, 2017
b3b2586
more things
Umcaruje May 24, 2017
6aa15a4
formatting fixes
Umcaruje May 30, 2017
8706d52
Remove update() from constructor
Umcaruje May 31, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
formatting fixes
  • Loading branch information
Umcaruje committed May 30, 2017
commit 6aa15a41d46c26424cec1ef967974f9dae3916e2
28 changes: 14 additions & 14 deletions include/TabWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,26 @@ class TabWidget : public QWidget
private:
struct widgetDesc
{
QWidget * w; // ptr to widget
const char *pixmap; // artwork for the widget
QString name; // name for widget
int nwidth; // width of name when painting (only valid for text tab)
QWidget * w; // ptr to widget
const char * pixmap; // artwork for the widget
QString name; // name for widget
int nwidth; // width of name when painting (only valid for text tab)
} ;
typedef QMap<int, widgetDesc> widgetStack;

widgetStack m_widgets;

int m_activeTab;
QString m_caption;
quint8 m_tabbarHeight; // The height of the tab bar
quint8 m_tabheight; // The height of the tabs
bool m_usePixmap; // true if the tabs are to be displayed with icons. False for text tabs.

QColor m_tabText; // The color of the tabs' text.
QColor m_tabTitleText; // The color of the TabWidget's title text.
QColor m_tabSelected; // The highlighting color for the selected tab.
QColor m_tabBackground; // The TabWidget's background color.
QColor m_tabBorder; // The TabWidget's borders color.
QString m_caption; // Tab caption, used as the tooltip text on icon tabs
quint8 m_tabbarHeight; // The height of the tab bar
quint8 m_tabheight; // The height of the tabs
bool m_usePixmap; // true if the tabs are to be displayed with icons. False for text tabs.

QColor m_tabText; // The color of the tabs' text.
QColor m_tabTitleText; // The color of the TabWidget's title text.
QColor m_tabSelected; // The highlighting color for the selected tab.
QColor m_tabBackground; // The TabWidget's background color.
QColor m_tabBorder; // The TabWidget's borders color.
} ;

#endif
30 changes: 16 additions & 14 deletions src/gui/widgets/TabWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* TabWidget.cpp - tabwidget for LMMS
*
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
*
* This file is part of LMMS - https://lmms.io
*
* This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -244,11 +244,10 @@ void TabWidget::paintEvent( QPaintEvent * pe )

// Draw all tabs
p.setPen( tabText() );
for( widgetStack::iterator it = first ; it != last ; ++it )
{

for( widgetStack::iterator it = first ; it != last ; ++it )
{
// Draw a text tab or a artwork tab.
if ( m_usePixmap )
if( m_usePixmap )
{
// Fixes tab's width, because original size is only correct for text tabs
( *it ).nwidth = tab_width;
Expand All @@ -263,12 +262,13 @@ void TabWidget::paintEvent( QPaintEvent * pe )
}

// Draw artwork
p.drawPixmap(tab_x_offset + ( ( *it ).nwidth - artwork.width() ) / 2, 1, artwork );
} else
p.drawPixmap(tab_x_offset + ( ( *it ).nwidth - artwork.width() ) / 2, 1, artwork );
}
else
{
// Highlight tab when active
if( it.key() == m_activeTab )
{
{
p.fillRect( tab_x_offset, 2, ( *it ).nwidth - 6, m_tabbarHeight - 4, tabSelected() );
}

Expand All @@ -287,8 +287,10 @@ void TabWidget::paintEvent( QPaintEvent * pe )
// Switch between tabs with mouse wheel
void TabWidget::wheelEvent( QWheelEvent * we )
{
if (we->y() > m_tabheight)
if( we->y() > m_tabheight )
{
return;
}

we->accept();
int dir = ( we->delta() < 0 ) ? 1 : -1;
Expand All @@ -311,7 +313,7 @@ QColor TabWidget::tabTitleText() const
}

// Set the color to be used to draw a TabWidget's title text (if any)
void TabWidget::setTabTitleText( const QColor & c )
void TabWidget::setTabTitleText( const QColor & c )
{
m_tabTitleText = c;
}
Expand All @@ -323,7 +325,7 @@ QColor TabWidget::tabText() const
}

// Set the color to be used to draw a TabWidget's text (if any)
void TabWidget::setTabText( const QColor & c )
void TabWidget::setTabText( const QColor & c )
{
m_tabText = c;
}
Expand All @@ -335,7 +337,7 @@ QColor TabWidget::tabSelected() const
}

// Set the color to be used to highlight a TabWidget'selected tab (if any)
void TabWidget::setTabSelected( const QColor & c )
void TabWidget::setTabSelected( const QColor & c )
{
m_tabSelected = c;
}
Expand All @@ -347,7 +349,7 @@ QColor TabWidget::tabBackground() const
}

// Set the color to be used for the TabWidget's background
void TabWidget::setTabBackground( const QColor & c )
void TabWidget::setTabBackground( const QColor & c )
{
m_tabBackground = c;
}
Expand All @@ -359,7 +361,7 @@ QColor TabWidget::tabBorder() const
}

// Set the color to be used for the TabWidget's borders
void TabWidget::setTabBorder( const QColor & c )
void TabWidget::setTabBorder( const QColor & c )
{
m_tabBorder = c;
}