mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Libraries and Folders titles added
This commit is contained in:
@ -11,7 +11,8 @@ HEADERS += $$PWD/help_about_dialog.h \
|
||||
$$PWD/yacreader_search_line_edit.h \
|
||||
$$PWD/yacreader_spin_slider_widget.h \
|
||||
$$PWD/yacreader_tool_bar_stretch.h \
|
||||
$$PWD/yacreader_dark_menu.h
|
||||
$$PWD/yacreader_dark_menu.h \
|
||||
$$PWD/yacreader_titled_toolbar.h
|
||||
|
||||
SOURCES += $$PWD/help_about_dialog.cpp \
|
||||
$$PWD/yacreader_field_edit.cpp \
|
||||
@ -23,4 +24,5 @@ SOURCES += $$PWD/help_about_dialog.cpp \
|
||||
$$PWD/yacreader_search_line_edit.cpp \
|
||||
$$PWD/yacreader_spin_slider_widget.cpp \
|
||||
$$PWD/yacreader_tool_bar_stretch.cpp \
|
||||
$$PWD/yacreader_dark_menu.cpp
|
||||
$$PWD/yacreader_dark_menu.cpp \
|
||||
$$PWD/yacreader_titled_toolbar.cpp
|
46
custom_widgets/yacreader_titled_toolbar.cpp
Normal file
46
custom_widgets/yacreader_titled_toolbar.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
#include "yacreader_titled_toolbar.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QPixmap>
|
||||
#include <QToolButton>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
|
||||
YACReaderTitledToolBar::YACReaderTitledToolBar(const QString & title, QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
QHBoxLayout * mainLayout = new QHBoxLayout;
|
||||
mainLayout->setMargin(0);
|
||||
mainLayout->setSpacing(0);
|
||||
|
||||
QString styleSheet = "QWidget {border:0px;}";
|
||||
setStyleSheet(styleSheet);
|
||||
|
||||
QLabel * nameLabel = new QLabel(title,this);
|
||||
|
||||
QString nameLabelStyleSheet = "QLabel {color:#454545; padding:0 0 0 0px; margin:0px; font-size:14px; font-weight:bold;}";
|
||||
nameLabel->setStyleSheet(nameLabelStyleSheet);
|
||||
|
||||
mainLayout->addWidget(nameLabel,Qt::AlignLeft);
|
||||
mainLayout->addStretch();
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
||||
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
|
||||
|
||||
setMinimumHeight(25);
|
||||
}
|
||||
|
||||
|
||||
void YACReaderTitledToolBar::addAction(QAction * action)
|
||||
{
|
||||
QHBoxLayout * mainLayout = dynamic_cast<QHBoxLayout *>(layout());
|
||||
|
||||
QToolButton * tb = new QToolButton(this);
|
||||
tb->setDefaultAction(action);
|
||||
tb->setIconSize(QSize(16,16));
|
||||
tb->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
|
||||
tb->setStyleSheet("QToolButton:hover {background-color:#A5A5A5;}");
|
||||
|
||||
mainLayout->addWidget(tb);
|
||||
}
|
20
custom_widgets/yacreader_titled_toolbar.h
Normal file
20
custom_widgets/yacreader_titled_toolbar.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef YACREADER_TITLED_TOOLBAR_H
|
||||
#define YACREADER_TITLED_TOOLBAR_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QIcon;
|
||||
|
||||
class YACReaderTitledToolBar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit YACReaderTitledToolBar(const QString & title, QWidget *parent = 0);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void addAction(QAction * action);
|
||||
};
|
||||
|
||||
#endif // YACREADER_TITLED_TOOLBAR_H
|
Reference in New Issue
Block a user