Move 'clear play queue' button to before search button
This commit is contained in:
committed by
craig.p.drummond
parent
aeeccd3d4e
commit
509c5d95aa
@@ -71,7 +71,7 @@ set(CANTATA_SRCS gui/application.cpp gui/main.cpp gui/initialsettingswizard.cpp
|
||||
widgets/actionlabel.cpp widgets/playqueueview.cpp widgets/groupedview.cpp widgets/actionitemdelegate.cpp widgets/textbrowser.cpp
|
||||
widgets/coverwidget.cpp widgets/volumecontrol.cpp widgets/icons.cpp widgets/genrecombo.cpp widgets/toolbar.cpp widgets/menubutton.cpp
|
||||
widgets/toolbutton.cpp widgets/wizardpage.cpp widgets/statuslabel.cpp widgets/searchwidget.cpp widgets/messageoverlay.cpp
|
||||
widgets/basicitemdelegate.cpp widgets/sizegrip.cpp widgets/sizewidget.cpp widgets/servicestatuslabel.cpp
|
||||
widgets/basicitemdelegate.cpp widgets/sizegrip.cpp widgets/sizewidget.cpp widgets/servicestatuslabel.cpp widgets/spacerwidget.cpp
|
||||
network/networkaccessmanager.cpp network/networkproxyfactory.cpp
|
||||
devices/deviceoptions.cpp
|
||||
context/lyricsettings.cpp context/ultimatelyricsprovider.cpp context/ultimatelyrics.cpp context/lyricsdialog.cpp
|
||||
|
||||
@@ -299,20 +299,13 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="SpacerWidget" name="horizontalSpacer_4"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ToolButton" name="clearPlayQueueButton"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SpacerWidget" name="horizontalSpacer_4b"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ToolButton" name="searchPlayQueueButton"/>
|
||||
@@ -320,9 +313,6 @@
|
||||
<item>
|
||||
<widget class="ToolButton" name="savePlayQueueButton"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ToolButton" name="clearPlayQueueButton"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SizeGrip" name="sizeGrip"/>
|
||||
</item>
|
||||
@@ -415,6 +405,11 @@
|
||||
<extends>QSizeGrip</extends>
|
||||
<header>sizegrip.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>SpacerWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>spacerwidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
58
widgets/spacerwidget.cpp
Normal file
58
widgets/spacerwidget.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Cantata
|
||||
*
|
||||
* Copyright (c) 2011-2013 Craig Drummond <craig.p.drummond@gmail.com>
|
||||
*
|
||||
* ----
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "spacerwidget.h"
|
||||
#include "toolbutton.h"
|
||||
#include <QPainter>
|
||||
#include <QLinearGradient>
|
||||
|
||||
static int fixedWidth=0;
|
||||
|
||||
SpacerWidget::SpacerWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
if (0==fixedWidth) {
|
||||
ToolButton tb(parent);
|
||||
tb.ensurePolished();
|
||||
fixedWidth=tb.sizeHint().width()*0.75;
|
||||
}
|
||||
setFixedWidth(fixedWidth);
|
||||
}
|
||||
|
||||
void SpacerWidget::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
QWidget::paintEvent(e);
|
||||
QPainter p(this);
|
||||
QColor col(palette().text().color());
|
||||
col.setAlphaF(0.333);
|
||||
QPoint start(width()/2, 0);
|
||||
QPoint end(width()/2, height()-1);
|
||||
QLinearGradient grad(start, end);
|
||||
grad.setColorAt(0.4, col);
|
||||
grad.setColorAt(0.6, col);
|
||||
col.setAlphaF(0);
|
||||
grad.setColorAt(0.1, col);
|
||||
grad.setColorAt(0.9, col);
|
||||
p.setPen(QPen(QBrush(grad), 1));
|
||||
p.drawLine(start, end);
|
||||
}
|
||||
38
widgets/spacerwidget.h
Normal file
38
widgets/spacerwidget.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Cantata
|
||||
*
|
||||
* Copyright (c) 2011-2013 Craig Drummond <craig.p.drummond@gmail.com>
|
||||
*
|
||||
* ----
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPACER_WIDGET_H
|
||||
#define SPACER_WIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class SpacerWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
SpacerWidget(QWidget *parent = 0);
|
||||
virtual ~SpacerWidget() { }
|
||||
|
||||
void paintEvent(QPaintEvent *e);
|
||||
};
|
||||
|
||||
#endif // TOOLBAR_H
|
||||
Reference in New Issue
Block a user