diff --git a/cmaintabbar.cpp b/cmaintabbar.cpp new file mode 100644 index 0000000..c22bf46 --- /dev/null +++ b/cmaintabbar.cpp @@ -0,0 +1,47 @@ +#include +#include +#include + +#include "cmaintabbar.h" + + +cMainTabBar::cMainTabBar(QWidget *parent) + : QTabBar(parent) +{ +} + +cMainTabBar::~cMainTabBar() +{ +} + +QSize cMainTabBar::tabSizeHint(int index) const +{ + QSize s = QTabBar::tabSizeHint(index); + s.setHeight(80); + return(s); +} + +void cMainTabBar::paintEvent(QPaintEvent*) +{ + QStylePainter p(this); + + for (int index = 0; index < count(); index++) + { + QStyleOptionTab tab; + initStyleOption(&tab, index); + + QIcon tempIcon = tabIcon(index); + QString tempText = this->tabText(index); + + QRect tabrect = tabRect(index); + + tab.icon = QIcon(); + tab.text = QString(); + + p.drawControl(QStyle::CE_TabBarTab, tab); + + tempIcon.paint(&p, tabrect, Qt::AlignTop); + tabrect.adjust(0, 0, 0, -2); + p.drawText(tabrect, Qt::AlignBottom | Qt::AlignHCenter, tempText ); + } +} diff --git a/cmaintabbar.h b/cmaintabbar.h new file mode 100644 index 0000000..d481f8b --- /dev/null +++ b/cmaintabbar.h @@ -0,0 +1,22 @@ +#ifndef CMAINTABBAR_H +#define CMAINTABBAR_H + + +#include +#include +#include + + +class cMainTabBar : public QTabBar +{ + Q_OBJECT +public: + cMainTabBar(QWidget *parent = Q_NULLPTR); + virtual ~cMainTabBar(); + +protected: + QSize tabSizeHint(int index) const; + void paintEvent(QPaintEvent *); +}; + +#endif // CMAINTABBAR_H diff --git a/cmaintabwidget.cpp b/cmaintabwidget.cpp new file mode 100644 index 0000000..dc21665 --- /dev/null +++ b/cmaintabwidget.cpp @@ -0,0 +1,9 @@ +#include "cmaintabwidget.h" +#include "cmaintabbar.h" + + +cMainTabWidget::cMainTabWidget(QWidget *parent) : + QTabWidget(parent) +{ + setTabBar(new cMainTabBar()); +} diff --git a/cmaintabwidget.h b/cmaintabwidget.h new file mode 100644 index 0000000..9206780 --- /dev/null +++ b/cmaintabwidget.h @@ -0,0 +1,14 @@ +#ifndef CMAINTABWIDGET_H +#define CMAINTABWIDGET_H + + +#include + + +class cMainTabWidget : public QTabWidget +{ +public: + cMainTabWidget(QWidget *parent = Q_NULLPTR); +}; + +#endif // CMAINTABWIDGET_H diff --git a/cmainwindow.cpp b/cmainwindow.cpp index 429ee18..99265d1 100644 --- a/cmainwindow.cpp +++ b/cmainwindow.cpp @@ -23,6 +23,12 @@ cMainWindow::~cMainWindow() if(m_lpTVShowWidget) delete m_lpTVShowWidget; + if(m_lpMusicWidget) + delete m_lpMusicWidget; + + if(m_lpMusicVideoWidget) + delete m_lpMusicVideoWidget; + delete ui; } @@ -30,11 +36,16 @@ void cMainWindow::initUI() { ui->setupUi(this); - m_lpMovieWidget = new cMovieWidget(this); - m_lpTVShowWidget = new cTVShowWidget(this); + m_lpMovieWidget = new cMovieWidget(this); + m_lpTVShowWidget = new cTVShowWidget(this); + m_lpMusicWidget = new cMusicWidget(this); + m_lpMusicVideoWidget = new cMusicVideosWidget(this); + + ui->m_lpMainTab->addTab(m_lpMovieWidget, QIcon(":/icons/Videos.ico"), "Movies"); + ui->m_lpMainTab->addTab(m_lpTVShowWidget, QIcon(":/icons/TV Shows.ico"), "TV Shows"); + ui->m_lpMainTab->addTab(m_lpMusicWidget, QIcon(":/icons/Musics.ico"), "Music"); + ui->m_lpMainTab->addTab(m_lpMusicVideoWidget, QIcon(":/icons/Videos.ico"), "Music Videos"); - ui->m_lpMainTab->addTab(m_lpMovieWidget, QIcon(":/icons/Videos.ico"), ""); - ui->m_lpMainTab->addTab(m_lpTVShowWidget, QIcon(":/icons/TV Shows.ico"), ""); ui->m_lpMainTab->setCurrentIndex(0); setWindowTitle("qtKodiAdmin"); diff --git a/cmainwindow.h b/cmainwindow.h index b8d8fe0..bd00ca3 100644 --- a/cmainwindow.h +++ b/cmainwindow.h @@ -4,6 +4,9 @@ #include "cmoviewidget.h" #include "ctvshowwidget.h" +#include "cmusicwidget.h" +#include "cmusicvideoswidget.h" + #include "ckodilibrary.h" #include @@ -26,6 +29,8 @@ private: Ui::cMainWindow* ui; cMovieWidget* m_lpMovieWidget; cTVShowWidget* m_lpTVShowWidget; + cMusicWidget* m_lpMusicWidget; + cMusicVideosWidget* m_lpMusicVideoWidget; cKodiLibrary m_kodiLibrary; void initUI(); diff --git a/cmainwindow.ui b/cmainwindow.ui index dccd5a4..8f63187 100644 --- a/cmainwindow.ui +++ b/cmainwindow.ui @@ -16,7 +16,7 @@ - + QTabWidget::West @@ -57,6 +57,14 @@ + + + cMainTabWidget + QTabWidget +
cmaintabwidget.h
+ 1 +
+
diff --git a/cmoviewidget.ui b/cmoviewidget.ui index 2efe06d..9b33a0d 100644 --- a/cmoviewidget.ui +++ b/cmoviewidget.ui @@ -16,14 +16,14 @@ - 130 - 280 + 100 + 80 47 13 - TextLabel + Movie
diff --git a/cmusicvideoswidget.cpp b/cmusicvideoswidget.cpp new file mode 100644 index 0000000..6b67526 --- /dev/null +++ b/cmusicvideoswidget.cpp @@ -0,0 +1,14 @@ +#include "cmusicvideoswidget.h" +#include "ui_cmusicvideoswidget.h" + +cMusicVideosWidget::cMusicVideosWidget(QWidget *parent) : + QWidget(parent), + ui(new Ui::cMusicVideosWidget) +{ + ui->setupUi(this); +} + +cMusicVideosWidget::~cMusicVideosWidget() +{ + delete ui; +} diff --git a/cmusicvideoswidget.h b/cmusicvideoswidget.h new file mode 100644 index 0000000..33a309f --- /dev/null +++ b/cmusicvideoswidget.h @@ -0,0 +1,22 @@ +#ifndef CMUSICVIDEOSWIDGET_H +#define CMUSICVIDEOSWIDGET_H + +#include + +namespace Ui { +class cMusicVideosWidget; +} + +class cMusicVideosWidget : public QWidget +{ + Q_OBJECT + +public: + explicit cMusicVideosWidget(QWidget *parent = 0); + ~cMusicVideosWidget(); + +private: + Ui::cMusicVideosWidget *ui; +}; + +#endif // CMUSICVIDEOSWIDGET_H diff --git a/cmusicvideoswidget.ui b/cmusicvideoswidget.ui new file mode 100644 index 0000000..3973d3d --- /dev/null +++ b/cmusicvideoswidget.ui @@ -0,0 +1,32 @@ + + + cMusicVideosWidget + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + 90 + 50 + 47 + 13 + + + + Music Videos + + + + + + diff --git a/cmusicwidget.cpp b/cmusicwidget.cpp new file mode 100644 index 0000000..a5fd751 --- /dev/null +++ b/cmusicwidget.cpp @@ -0,0 +1,14 @@ +#include "cmusicwidget.h" +#include "ui_cmusicwidget.h" + +cMusicWidget::cMusicWidget(QWidget *parent) : + QWidget(parent), + ui(new Ui::cMusicWidget) +{ + ui->setupUi(this); +} + +cMusicWidget::~cMusicWidget() +{ + delete ui; +} diff --git a/cmusicwidget.h b/cmusicwidget.h new file mode 100644 index 0000000..526bca6 --- /dev/null +++ b/cmusicwidget.h @@ -0,0 +1,22 @@ +#ifndef CMUSICWIDGET_H +#define CMUSICWIDGET_H + +#include + +namespace Ui { +class cMusicWidget; +} + +class cMusicWidget : public QWidget +{ + Q_OBJECT + +public: + explicit cMusicWidget(QWidget *parent = 0); + ~cMusicWidget(); + +private: + Ui::cMusicWidget *ui; +}; + +#endif // CMUSICWIDGET_H diff --git a/cmusicwidget.ui b/cmusicwidget.ui new file mode 100644 index 0000000..ed1862d --- /dev/null +++ b/cmusicwidget.ui @@ -0,0 +1,32 @@ + + + cMusicWidget + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + 50 + 40 + 47 + 13 + + + + Music + + + + + + diff --git a/ctvshowwidget.ui b/ctvshowwidget.ui index b364e4f..ce0fb71 100644 --- a/ctvshowwidget.ui +++ b/ctvshowwidget.ui @@ -23,7 +23,7 @@ - TextLabel1 + TV Show
diff --git a/icons/TV Shows.ico b/icons/TV Shows.ico index f64d925..2efc95d 100644 Binary files a/icons/TV Shows.ico and b/icons/TV Shows.ico differ diff --git a/icons/Videos.ico b/icons/Videos.ico index f766b91..d43c352 100644 Binary files a/icons/Videos.ico and b/icons/Videos.ico differ diff --git a/main.cpp b/main.cpp index a9dc9d3..02abf7a 100644 --- a/main.cpp +++ b/main.cpp @@ -6,6 +6,8 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); cMainWindow w; w.showMaximized(); + //w.show(); + //w.resize(100, 100); return a.exec(); } diff --git a/qtKodiDB.pro b/qtKodiDB.pro index 57f9a7c..c6c4c40 100644 --- a/qtKodiDB.pro +++ b/qtKodiDB.pro @@ -17,17 +17,27 @@ SOURCES += main.cpp\ ckodivideolibrary.cpp \ ckodilibrary.cpp \ cmoviewidget.cpp \ - ctvshowwidget.cpp + ctvshowwidget.cpp \ + cmaintabbar.cpp \ + cmaintabwidget.cpp \ + cmusicwidget.cpp \ + cmusicvideoswidget.cpp HEADERS += cmainwindow.h \ ckodivideolibrary.h \ ckodilibrary.h \ cmoviewidget.h \ - ctvshowwidget.h + ctvshowwidget.h \ + cmaintabbar.h \ + cmaintabwidget.h \ + cmusicwidget.h \ + cmusicvideoswidget.h FORMS += cmainwindow.ui \ cmoviewidget.ui \ - ctvshowwidget.ui + ctvshowwidget.ui \ + cmusicwidget.ui \ + cmusicvideoswidget.ui RESOURCES += \ qtkodidb.qrc