aaa
This commit is contained in:
parent
58fcce8f0a
commit
dfd193b2de
@ -194,6 +194,7 @@ set(APP_SOURCES
|
|||||||
src/gui/feedmessageviewer.cpp
|
src/gui/feedmessageviewer.cpp
|
||||||
src/gui/feedsview.cpp
|
src/gui/feedsview.cpp
|
||||||
src/gui/messagesview.cpp
|
src/gui/messagesview.cpp
|
||||||
|
src/gui/statusbar.cpp
|
||||||
|
|
||||||
# CORE sources.
|
# CORE sources.
|
||||||
src/core/debugging.cpp
|
src/core/debugging.cpp
|
||||||
@ -242,6 +243,7 @@ set(APP_HEADERS
|
|||||||
src/gui/feedmessageviewer.h
|
src/gui/feedmessageviewer.h
|
||||||
src/gui/feedsview.h
|
src/gui/feedsview.h
|
||||||
src/gui/messagesview.h
|
src/gui/messagesview.h
|
||||||
|
src/gui/statusbar.h
|
||||||
|
|
||||||
# CORE headers.
|
# CORE headers.
|
||||||
src/core/settings.h
|
src/core/settings.h
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
#include "gui/cornerbutton.h"
|
#include "gui/cornerbutton.h"
|
||||||
|
#include "gui/iconthemefactory.h"
|
||||||
|
|
||||||
|
|
||||||
CornerButton::CornerButton(QWidget *parent) : QPushButton(parent) {
|
CornerButton::CornerButton(QWidget *parent) : QToolButton(parent) {
|
||||||
setToolTip(tr("Open new tab"));
|
setToolTip(tr("Open new tab"));
|
||||||
|
setAutoRaise(true);
|
||||||
|
setIcon(IconThemeFactory::getInstance()->fromTheme("list-add"));
|
||||||
}
|
}
|
||||||
|
|
||||||
CornerButton::~CornerButton() {
|
CornerButton::~CornerButton() {
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
#ifndef CORNERBUTTON_H
|
#ifndef CORNERBUTTON_H
|
||||||
#define CORNERBUTTON_H
|
#define CORNERBUTTON_H
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
|
|
||||||
class CornerButton : public QPushButton {
|
class CornerButton : public QToolButton {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// Contructors and destructors.
|
||||||
explicit CornerButton(QWidget *parent = 0);
|
explicit CornerButton(QWidget *parent = 0);
|
||||||
virtual ~CornerButton();
|
virtual ~CornerButton();
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CORNERBUTTON_H
|
#endif // CORNERBUTTON_H
|
||||||
|
@ -17,10 +17,22 @@ FeedMessageViewer::FeedMessageViewer(QWidget *parent)
|
|||||||
m_feedsView(new FeedsView(this)),
|
m_feedsView(new FeedsView(this)),
|
||||||
m_messagesBrowser(new WebBrowser(this))
|
m_messagesBrowser(new WebBrowser(this))
|
||||||
{
|
{
|
||||||
m_messagesBrowser->setNavigationBarVisible(false);
|
initialize();
|
||||||
initializeViews();
|
initializeViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FeedMessageViewer::initialize() {
|
||||||
|
// Initialize/populate toolbar.
|
||||||
|
m_toolBar->setFloatable(false);
|
||||||
|
m_toolBar->setMovable(false);
|
||||||
|
m_toolBar->setAllowedAreas(Qt::TopToolBarArea);
|
||||||
|
|
||||||
|
m_toolBar->addAction(QIcon::fromTheme("application-exit"), "aaa");
|
||||||
|
|
||||||
|
// Finish web/message browser setup.
|
||||||
|
m_messagesBrowser->setNavigationBarVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
void FeedMessageViewer::initializeViews() {
|
void FeedMessageViewer::initializeViews() {
|
||||||
// Instantiate needed components.
|
// Instantiate needed components.
|
||||||
QVBoxLayout *central_layout = new QVBoxLayout(this);
|
QVBoxLayout *central_layout = new QVBoxLayout(this);
|
||||||
@ -48,8 +60,6 @@ void FeedMessageViewer::initializeViews() {
|
|||||||
feed_splitter->addWidget(m_feedsView);
|
feed_splitter->addWidget(m_feedsView);
|
||||||
feed_splitter->addWidget(message_splitter);
|
feed_splitter->addWidget(message_splitter);
|
||||||
|
|
||||||
m_toolBar->addAction(QIcon::fromTheme("application-exit"), "aaa");
|
|
||||||
|
|
||||||
// Add toolbar and main feeds/messages widget to main layout.
|
// Add toolbar and main feeds/messages widget to main layout.
|
||||||
central_layout->addWidget(m_toolBar);
|
central_layout->addWidget(m_toolBar);
|
||||||
central_layout->addWidget(feed_splitter);
|
central_layout->addWidget(feed_splitter);
|
||||||
|
@ -13,12 +13,18 @@ class FeedMessageViewer : public TabContent {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// Constructors and destructors.
|
||||||
explicit FeedMessageViewer(QWidget *parent = 0);
|
explicit FeedMessageViewer(QWidget *parent = 0);
|
||||||
virtual ~FeedMessageViewer();
|
virtual ~FeedMessageViewer();
|
||||||
|
|
||||||
|
// WebBrowser getter from TabContent interface.
|
||||||
WebBrowser *webBrowser();
|
WebBrowser *webBrowser();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// Initializes some properties of the widget.
|
||||||
|
void initialize();
|
||||||
|
|
||||||
|
// Initializes both messages/feeds views.
|
||||||
void initializeViews();
|
void initializeViews();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "gui/iconthemefactory.h"
|
#include "gui/iconthemefactory.h"
|
||||||
#include "gui/systemtrayicon.h"
|
#include "gui/systemtrayicon.h"
|
||||||
#include "gui/tabbar.h"
|
#include "gui/tabbar.h"
|
||||||
|
#include "gui/statusbar.h"
|
||||||
#include "core/settings.h"
|
#include "core/settings.h"
|
||||||
#include "core/defs.h"
|
#include "core/defs.h"
|
||||||
#include "qtsingleapplication/qtsingleapplication.h"
|
#include "qtsingleapplication/qtsingleapplication.h"
|
||||||
@ -20,6 +21,8 @@ FormMain::FormMain(QWidget *parent) : QMainWindow(parent), m_ui(new Ui::FormMain
|
|||||||
// Initialize singleton.
|
// Initialize singleton.
|
||||||
s_instance = this;
|
s_instance = this;
|
||||||
|
|
||||||
|
setStatusBar(new StatusBar(this));
|
||||||
|
|
||||||
// Prepare main window and tabs.
|
// Prepare main window and tabs.
|
||||||
prepareMenus();
|
prepareMenus();
|
||||||
|
|
||||||
|
9
src/gui/statusbar.cpp
Normal file
9
src/gui/statusbar.cpp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "gui/statusbar.h"
|
||||||
|
|
||||||
|
|
||||||
|
StatusBar::StatusBar(QWidget *parent) : QStatusBar(parent) {
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusBar::~StatusBar() {
|
||||||
|
qDebug("Destroying StatusBar instance.");
|
||||||
|
}
|
21
src/gui/statusbar.h
Normal file
21
src/gui/statusbar.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#ifndef STATUSBAR_H
|
||||||
|
#define STATUSBAR_H
|
||||||
|
|
||||||
|
#include <QStatusBar>
|
||||||
|
|
||||||
|
|
||||||
|
class StatusBar : public QStatusBar {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Constructors and destructors.
|
||||||
|
explicit StatusBar(QWidget *parent = 0);
|
||||||
|
virtual ~StatusBar();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // STATUSBAR_H
|
@ -1,6 +1,5 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
#include "core/defs.h"
|
#include "core/defs.h"
|
||||||
#include "core/settings.h"
|
#include "core/settings.h"
|
||||||
@ -25,8 +24,6 @@ TabWidget::~TabWidget() {
|
|||||||
|
|
||||||
void TabWidget::setupCornerButton() {
|
void TabWidget::setupCornerButton() {
|
||||||
m_cornerButton = new CornerButton(this);
|
m_cornerButton = new CornerButton(this);
|
||||||
m_cornerButton->setFlat(true);
|
|
||||||
m_cornerButton->setIcon(IconThemeFactory::getInstance()->fromTheme("list-add"));
|
|
||||||
setCornerWidget(m_cornerButton);
|
setCornerWidget(m_cornerButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@ WebBrowser::WebBrowser(QWidget *parent)
|
|||||||
m_runningWebBrowsers.append(this);
|
m_runningWebBrowsers.append(this);
|
||||||
|
|
||||||
// Set properties of some components.
|
// Set properties of some components.
|
||||||
m_toolBar->layout()->setMargin(0);
|
|
||||||
m_toolBar->setFloatable(false);
|
m_toolBar->setFloatable(false);
|
||||||
m_toolBar->setMovable(false);
|
m_toolBar->setMovable(false);
|
||||||
m_toolBar->setAllowedAreas(Qt::TopToolBarArea);
|
m_toolBar->setAllowedAreas(Qt::TopToolBarArea);
|
||||||
@ -64,12 +63,12 @@ WebBrowser::WebBrowser(QWidget *parent)
|
|||||||
m_toolBar->addAction(m_actionReload);
|
m_toolBar->addAction(m_actionReload);
|
||||||
m_toolBar->addAction(m_actionStop);
|
m_toolBar->addAction(m_actionStop);
|
||||||
m_toolBar->addWidget(m_txtLocation);
|
m_toolBar->addWidget(m_txtLocation);
|
||||||
//m_toolBar->setContentsMargins(0, 0, 0, -3);
|
|
||||||
|
|
||||||
// Setup layout.
|
// Setup layout.
|
||||||
m_layout->addWidget(m_toolBar);
|
m_layout->addWidget(m_toolBar);
|
||||||
m_layout->addWidget(m_webView);
|
m_layout->addWidget(m_webView);
|
||||||
m_layout->setMargin(0);
|
m_layout->setMargin(0);
|
||||||
|
m_layout->setSpacing(0);
|
||||||
|
|
||||||
setTabOrder(m_txtLocation, m_toolBar);
|
setTabOrder(m_txtLocation, m_toolBar);
|
||||||
setTabOrder(m_toolBar, m_webView);
|
setTabOrder(m_toolBar, m_webView);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user