mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 17:18:23 -04:00
Update files format with clang-format
This commit is contained in:
parent
732ea7ecac
commit
f945c6c5ca
@ -7,7 +7,7 @@ class ComicsViewTransition : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ComicsViewTransition(const QString& backgroundColor, QWidget *parent = nullptr);
|
||||
explicit ComicsViewTransition(const QString &backgroundColor, QWidget *parent = nullptr);
|
||||
QSize sizeHint();
|
||||
|
||||
protected:
|
||||
|
@ -162,8 +162,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
|
||||
return QVariant(finishedFolderIcon);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return QVariant(QFileIconProvider().icon(QFileIconProvider::Folder));
|
||||
}
|
||||
} else {
|
||||
|
@ -129,7 +129,7 @@ QIcon ReadingListItem::getIcon() const
|
||||
if (parent->getId() == 0)
|
||||
return YACReader::noHighlightedIcon(":/images/lists/list.png"); //top level list
|
||||
else {
|
||||
if(Theme::currentTheme().useNativeFolderIcons)
|
||||
if (Theme::currentTheme().useNativeFolderIcons)
|
||||
return QFileIconProvider().icon(QFileIconProvider::Folder);
|
||||
else
|
||||
return YACReader::noHighlightedIcon(":/images/sidebar/folder.png"); //sublist
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "theme.h"
|
||||
|
||||
EmptyContainerInfo::EmptyContainerInfo(QWidget *parent)
|
||||
: QWidget(parent), iconLabel(new QLabel()), titleLabel(new QLabel())
|
||||
: QWidget(parent), iconLabel(new QLabel()), titleLabel(new QLabel())
|
||||
{
|
||||
auto theme = Theme::currentTheme();
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "theme.h"
|
||||
|
||||
void testListView(QListView * l)
|
||||
void testListView(QListView *l)
|
||||
{
|
||||
QStringListModel *slm = new QStringListModel(QStringList() << "Lorem ipsum"
|
||||
<< "Hailer skualer"
|
||||
@ -84,7 +84,7 @@ EmptyFolderWidget::EmptyFolderWidget(QWidget *parent)
|
||||
|
||||
foldersView->setStyleSheet(theme.emptyFolderWidgetStyle);
|
||||
|
||||
foldersView->setSizePolicy(QSizePolicy ::Expanding, QSizePolicy ::Expanding );
|
||||
foldersView->setSizePolicy(QSizePolicy ::Expanding, QSizePolicy ::Expanding);
|
||||
|
||||
layout->addSpacing(12);
|
||||
layout->addWidget(foldersView, 1);
|
||||
|
@ -101,8 +101,7 @@ LibraryWindow::LibraryWindow()
|
||||
|
||||
if (libraries.isEmpty()) {
|
||||
showNoLibrariesWidget();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
showRootWidget();
|
||||
selectedLibrary->setCurrentIndex(0);
|
||||
}
|
||||
@ -115,7 +114,7 @@ void LibraryWindow::setupUI()
|
||||
libraryCreator = new LibraryCreator();
|
||||
packageManager = new PackageManager();
|
||||
|
||||
settings = new QSettings(YACReader::getSettingsPath()+"/YACReaderLibrary.ini", QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor
|
||||
settings = new QSettings(YACReader::getSettingsPath() + "/YACReaderLibrary.ini", QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor
|
||||
settings->beginGroup("libraryConfig");
|
||||
|
||||
historyController = new YACReaderHistoryController(this);
|
||||
@ -169,7 +168,7 @@ void LibraryWindow::setupUI()
|
||||
void LibraryWindow::doLayout()
|
||||
{
|
||||
//LAYOUT ELEMENTS------------------------------------------------------------
|
||||
auto sHorizontal = new QSplitter(Qt::Horizontal); //spliter principal
|
||||
auto sHorizontal = new QSplitter(Qt::Horizontal); //spliter principal
|
||||
|
||||
sHorizontal->setStyleSheet(theme.mainWindowHorizontalSpliterStyle);
|
||||
|
||||
@ -263,7 +262,7 @@ void LibraryWindow::doLayout()
|
||||
|
||||
//collapsible disabled in macosx (only temporaly)
|
||||
if (theme.isMacosNative) {
|
||||
sHorizontal->setCollapsible(0,false);
|
||||
sHorizontal->setCollapsible(0, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -735,7 +734,7 @@ void LibraryWindow::disableAllActions()
|
||||
|
||||
void LibraryWindow::createToolBars()
|
||||
{
|
||||
editInfoToolBar->setIconSize(QSize(18,18));
|
||||
editInfoToolBar->setIconSize(QSize(18, 18));
|
||||
editInfoToolBar->addAction(openComicAction);
|
||||
editInfoToolBar->addSeparator();
|
||||
editInfoToolBar->addAction(editSelectedComicsAction);
|
||||
@ -938,8 +937,8 @@ void LibraryWindow::createConnections()
|
||||
connect(libraryToolBar->toggleFullScreenAction, SIGNAL(triggered()), this, SLOT(toggleFullScreen()));
|
||||
}
|
||||
|
||||
connect(libraryToolBar->toggleComicsViewAction,SIGNAL(triggered()),comicsViewsManager,SLOT(toggleComicsView()));
|
||||
connect(libraryToolBar->optionsAction, SIGNAL(triggered()),optionsDialog,SLOT(show()));
|
||||
connect(libraryToolBar->toggleComicsViewAction, SIGNAL(triggered()), comicsViewsManager, SLOT(toggleComicsView()));
|
||||
connect(libraryToolBar->optionsAction, SIGNAL(triggered()), optionsDialog, SLOT(show()));
|
||||
#ifdef SERVER_RELEASE
|
||||
connect(libraryToolBar->serverConfigAction, SIGNAL(triggered()), serverConfigDialog, SLOT(show()));
|
||||
#endif
|
||||
@ -1085,24 +1084,21 @@ void LibraryWindow::loadLibrary(const QString &name)
|
||||
|
||||
setRootIndex();
|
||||
|
||||
|
||||
libraryToolBar->searchEdit->clear();
|
||||
}
|
||||
else if(comparation > 0) {
|
||||
int ret = QMessageBox::question(this,tr("Download new version"),tr("This library was created with a newer version of YACReaderLibrary. Download the new version now?"),QMessageBox::Yes,QMessageBox::No);
|
||||
if(ret == QMessageBox::Yes)
|
||||
} else if (comparation > 0) {
|
||||
int ret = QMessageBox::question(this, tr("Download new version"), tr("This library was created with a newer version of YACReaderLibrary. Download the new version now?"), QMessageBox::Yes, QMessageBox::No);
|
||||
if (ret == QMessageBox::Yes)
|
||||
QDesktopServices::openUrl(QUrl("http://www.yacreader.com"));
|
||||
|
||||
comicsViewsManager->comicsView->setModel(nullptr);
|
||||
foldersView->setModel(nullptr);
|
||||
listsView->setModel(nullptr);
|
||||
disableAllActions();//TODO comprobar que se deben deshabilitar
|
||||
disableAllActions(); //TODO comprobar que se deben deshabilitar
|
||||
//será possible renombrar y borrar estas bibliotecas
|
||||
renameLibraryAction->setEnabled(true);
|
||||
removeLibraryAction->setEnabled(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
comicsViewsManager->comicsView->setModel(nullptr);
|
||||
foldersView->setModel(nullptr);
|
||||
listsView->setModel(nullptr);
|
||||
@ -1610,12 +1606,11 @@ void LibraryWindow::checkEmptyFolder()
|
||||
{
|
||||
if (comicsModel->rowCount() > 0 && !importedCovers) {
|
||||
disableComicsActions(false);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
disableComicsActions(true);
|
||||
|
||||
if (libraryToolBar->toggleFullScreenAction != nullptr) {
|
||||
if(comicsModel->rowCount() > 0)
|
||||
if (comicsModel->rowCount() > 0)
|
||||
libraryToolBar->toggleFullScreenAction->setEnabled(true);
|
||||
}
|
||||
|
||||
@ -1699,7 +1694,7 @@ void LibraryWindow::create(QString source, QString dest, QString name)
|
||||
{
|
||||
QLOG_INFO() << QString("About to create a library from '%1' to '%2' with name '%3'").arg(source).arg(dest).arg(name);
|
||||
|
||||
libraryCreator->createLibrary(source,dest);
|
||||
libraryCreator->createLibrary(source, dest);
|
||||
libraryCreator->start();
|
||||
_lastAdded = name;
|
||||
_sourceLastAdded = source;
|
||||
@ -1836,7 +1831,7 @@ void LibraryWindow::rename(QString newName) //TODO replace
|
||||
QString currentLibrary = selectedLibrary->currentText();
|
||||
if (newName != currentLibrary) {
|
||||
if (!libraries.contains(newName)) {
|
||||
libraries.rename(currentLibrary,newName);
|
||||
libraries.rename(currentLibrary, newName);
|
||||
//selectedLibrary->removeItem(selectedLibrary->currentIndex());
|
||||
//libraries.addLibrary(newName,path);
|
||||
selectedLibrary->renameCurrentLibrary(newName);
|
||||
@ -1844,15 +1839,13 @@ void LibraryWindow::rename(QString newName) //TODO replace
|
||||
renameLibraryDialog->close();
|
||||
|
||||
if (!theme.isMacosNative) {
|
||||
if(!foldersModelProxy->mapToSource(foldersView->currentIndex()).isValid())
|
||||
if (!foldersModelProxy->mapToSource(foldersView->currentIndex()).isValid())
|
||||
libraryToolBar->setTitle(selectedLibrary->currentText());
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
libraryAlreadyExists(newName);
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
renameLibraryDialog->close();
|
||||
//selectedLibrary->setCurrentIndex(selectedLibrary->findText(newName));
|
||||
}
|
||||
|
@ -90,26 +90,26 @@ class LibraryWindow : public QMainWindow
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
YACReaderSideBar * sideBar;
|
||||
YACReaderSideBar *sideBar;
|
||||
|
||||
CreateLibraryDialog * createLibraryDialog;
|
||||
ExportLibraryDialog * exportLibraryDialog;
|
||||
ImportLibraryDialog * importLibraryDialog;
|
||||
ExportComicsInfoDialog * exportComicsInfoDialog;
|
||||
ImportComicsInfoDialog * importComicsInfoDialog;
|
||||
AddLibraryDialog * addLibraryDialog;
|
||||
LibraryCreator * libraryCreator;
|
||||
HelpAboutDialog * had;
|
||||
RenameLibraryDialog * renameLibraryDialog;
|
||||
PropertiesDialog * propertiesDialog;
|
||||
ComicVineDialog * comicVineDialog;
|
||||
EditShortcutsDialog * editShortcutsDialog;
|
||||
CreateLibraryDialog *createLibraryDialog;
|
||||
ExportLibraryDialog *exportLibraryDialog;
|
||||
ImportLibraryDialog *importLibraryDialog;
|
||||
ExportComicsInfoDialog *exportComicsInfoDialog;
|
||||
ImportComicsInfoDialog *importComicsInfoDialog;
|
||||
AddLibraryDialog *addLibraryDialog;
|
||||
LibraryCreator *libraryCreator;
|
||||
HelpAboutDialog *had;
|
||||
RenameLibraryDialog *renameLibraryDialog;
|
||||
PropertiesDialog *propertiesDialog;
|
||||
ComicVineDialog *comicVineDialog;
|
||||
EditShortcutsDialog *editShortcutsDialog;
|
||||
//YACReaderSocialDialog * socialDialog;
|
||||
bool fullscreen;
|
||||
bool importedCovers; //if true, the library is read only (not updates,open comic or properties)
|
||||
bool fromMaximized;
|
||||
|
||||
PackageManager * packageManager;
|
||||
PackageManager *packageManager;
|
||||
|
||||
QSize slideSizeW;
|
||||
QSize slideSizeF;
|
||||
@ -148,15 +148,15 @@ public:
|
||||
QAction *exportLibraryAction;
|
||||
QAction *importLibraryAction;
|
||||
|
||||
QAction * updateLibraryAction;
|
||||
QAction * removeLibraryAction;
|
||||
QAction * renameLibraryAction;
|
||||
QAction *updateLibraryAction;
|
||||
QAction *removeLibraryAction;
|
||||
QAction *renameLibraryAction;
|
||||
|
||||
//QAction * socialAction;
|
||||
|
||||
//tree actions
|
||||
QAction * addFolderAction;
|
||||
QAction * deleteFolderAction;
|
||||
QAction *addFolderAction;
|
||||
QAction *deleteFolderAction;
|
||||
//--
|
||||
QAction *setRootIndexAction;
|
||||
QAction *expandAllNodesAction;
|
||||
|
@ -13,11 +13,11 @@ class OptionsDialog : public YACReaderOptionsDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
OptionsDialog(QWidget * parent = nullptr);
|
||||
OptionsDialog(QWidget *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void editApiKey();
|
||||
void restoreOptions(QSettings * settings) override;
|
||||
void restoreOptions(QSettings *settings) override;
|
||||
|
||||
private slots:
|
||||
void useBackgroundImageCheckClicked(bool checked);
|
||||
|
@ -2,5 +2,4 @@
|
||||
|
||||
Theme::Theme()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,8 @@ class Theme
|
||||
public:
|
||||
Theme();
|
||||
|
||||
static Theme currentTheme() {
|
||||
static Theme currentTheme()
|
||||
{
|
||||
Theme t;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
@ -121,11 +122,11 @@ public:
|
||||
t.mainWindowHorizontalSpliterStyle = "QSplitter::handle{image:none;background-color:#B8B8B8;} QSplitter::handle:vertical {height:1px;}";
|
||||
} else {
|
||||
t.isMacosNative = false;
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
t.useNativeFullScreen = true;
|
||||
#else
|
||||
#else
|
||||
t.useNativeFullScreen = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
t.disableClassicViewCollapsing = false;
|
||||
|
||||
@ -162,7 +163,7 @@ public:
|
||||
|
||||
//
|
||||
t.sidebarBackgroundColor = "#454545";
|
||||
t.sidebarSplitterStyle = "QSplitter::handle:vertical { height: 39px; background-color: transparent;}";/*"QSplitter::handle { "
|
||||
t.sidebarSplitterStyle = "QSplitter::handle:vertical { height: 39px; background-color: transparent;}"; /*"QSplitter::handle { "
|
||||
" image: none; background-color = black; "
|
||||
" }"
|
||||
"QSplitter::handle:vertical { height: 39px;}"*/
|
||||
@ -234,7 +235,7 @@ public:
|
||||
"QTableView {border-top:1px solid #B8B8B8;border-bottom:none;border-left:1px solid #B8B8B8;border-right:none;}"
|
||||
|
||||
"QTableView::item:selected {outline: 0px; border-bottom: 1px solid #D4D4D4;border-top: 1px solid #D4D4D4; padding-bottom:1px; background-color: #D4D4D4; }"
|
||||
"QHeaderView::section:horizontal {background-color:#F5F5F5; border-bottom:1px solid #B8BDC4; border-right:1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D1D1D1, stop: 1 #B8BDC4); border-left:none; border-top:none; padding:4px; color:#313232;}"
|
||||
"QHeaderView::section:horizontal {background-color:#F5F5F5; border-bottom:1px solid #B8BDC4; border-right:1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D1D1D1, stop: 1 #B8BDC4); border-left:none; border-top:none; padding:4px; color:#313232;}"
|
||||
"QHeaderView::section:vertical {border-bottom: 1px solid #DFDFDF;border-top: 1px solid #FEFEFE;}";
|
||||
|
||||
t.mainWindowHorizontalSpliterStyle = "QSplitter::handle:vertical {height:4px;}";
|
||||
@ -243,19 +244,20 @@ public:
|
||||
return t;
|
||||
}
|
||||
|
||||
void configureComicsGridView(QQmlContext *ctxt) {
|
||||
ctxt->setContextProperty("backgroundColor", gridComicsViewBackgroundColor );
|
||||
void configureComicsGridView(QQmlContext *ctxt)
|
||||
{
|
||||
ctxt->setContextProperty("backgroundColor", gridComicsViewBackgroundColor);
|
||||
ctxt->setContextProperty("cellColor", gridComicsViewCellColor);
|
||||
ctxt->setContextProperty("selectedColor", gridComicsViewSelectedColor);
|
||||
ctxt->setContextProperty("selectedBorderColor", gridComicsViewSelectedBorderColor);
|
||||
ctxt->setContextProperty("borderColor", gridComicsViewBorderColor);
|
||||
ctxt->setContextProperty("titleColor", gridComicsViewTitleColor);
|
||||
ctxt->setContextProperty("textColor", gridComicsViewTextColor);
|
||||
ctxt->setContextProperty("useDropShadows",useDropShadows);
|
||||
ctxt->setContextProperty("useDropShadows", useDropShadows);
|
||||
//fonts settings
|
||||
if (gridComicsViewFontSize < 1) {
|
||||
int fontSize = QApplication::font().pointSize();
|
||||
if(fontSize == -1)
|
||||
if (fontSize == -1)
|
||||
fontSize = QApplication::font().pixelSize();
|
||||
|
||||
ctxt->setContextProperty("fontSize", fontSize);
|
||||
@ -269,7 +271,8 @@ public:
|
||||
ctxt->setContextProperty("currentComicBackgroundColor", gridComicsViewCurrentComicBackground);
|
||||
}
|
||||
|
||||
void configureInfoView(QQmlContext *ctxt) {
|
||||
void configureInfoView(QQmlContext *ctxt)
|
||||
{
|
||||
ctxt->setContextProperty("infoBackgroundColor", infoViewInfoBackgroundColor);
|
||||
ctxt->setContextProperty("topShadow", infoViewTopShadow);
|
||||
ctxt->setContextProperty("infoShadow", infoViewInfoShadow);
|
||||
@ -287,7 +290,7 @@ public:
|
||||
ctxt->setContextProperty("readTickUncheckedColor", infoViewReadTickUncheckedColor);
|
||||
ctxt->setContextProperty("readTickCheckedColor", infoViewReadTickCheckedColor);
|
||||
|
||||
ctxt->setContextProperty("useDropShadows",useDropShadows);
|
||||
ctxt->setContextProperty("useDropShadows", useDropShadows);
|
||||
}
|
||||
|
||||
bool isMacosNative;
|
||||
|
@ -173,9 +173,8 @@ void YACReaderComicsViewsManager::switchToComicsView(ComicsView *from, ComicsVie
|
||||
//load content into current view
|
||||
libraryWindow->loadCoversFromCurrentModel();
|
||||
|
||||
if (!libraryWindow->libraryToolBar->searchEdit->text().isEmpty())
|
||||
{
|
||||
comicsView->enableFilterMode(true);
|
||||
if (!libraryWindow->libraryToolBar->searchEdit->text().isEmpty()) {
|
||||
comicsView->enableFilterMode(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,7 +209,7 @@ void YACReaderComicsViewsManager::_toggleComicsView()
|
||||
libraryWindow->libraryToolBar->updateViewSelectorIcon(icoViewsButton);
|
||||
|
||||
if (infoComicsView == nullptr)
|
||||
infoComicsView = new InfoComicsView();
|
||||
infoComicsView = new InfoComicsView();
|
||||
|
||||
switchToComicsView(gridComicsView, infoComicsView);
|
||||
comicsViewStatus = Info;
|
||||
@ -224,7 +223,7 @@ void YACReaderComicsViewsManager::_toggleComicsView()
|
||||
libraryWindow->libraryToolBar->toggleComicsViewAction->setIcon(icoViewsButton);
|
||||
libraryWindow->libraryToolBar->updateViewSelectorIcon(icoViewsButton);
|
||||
|
||||
if(classicComicsView == nullptr)
|
||||
if (classicComicsView == nullptr)
|
||||
classicComicsView = new ClassicComicsView(theme.disableClassicViewCollapsing);
|
||||
|
||||
switchToComicsView(infoComicsView, classicComicsView);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
YACReaderLibrarySearchEdit::YACReaderLibrarySearchEdit(YACReaderMacOSXSearchLineEdit *searchEdit)
|
||||
:macosSearchEdit(searchEdit), defaultSearchEdit(nullptr)
|
||||
: macosSearchEdit(searchEdit), defaultSearchEdit(nullptr)
|
||||
{
|
||||
connect(searchEdit,
|
||||
&YACReaderMacOSXSearchLineEdit::filterChanged,
|
||||
@ -12,7 +12,7 @@ YACReaderLibrarySearchEdit::YACReaderLibrarySearchEdit(YACReaderMacOSXSearchLine
|
||||
#endif
|
||||
|
||||
YACReaderLibrarySearchEdit::YACReaderLibrarySearchEdit(YACReaderSearchLineEdit *searchEdit)
|
||||
:defaultSearchEdit(searchEdit)
|
||||
: defaultSearchEdit(searchEdit)
|
||||
{
|
||||
connect(searchEdit,
|
||||
&YACReaderSearchLineEdit::filterChanged,
|
||||
@ -25,9 +25,9 @@ void YACReaderLibrarySearchEdit::clear()
|
||||
if (defaultSearchEdit != nullptr) {
|
||||
defaultSearchEdit->clear();
|
||||
} else {
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
macosSearchEdit->clear();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,9 +36,9 @@ void YACReaderLibrarySearchEdit::clearText()
|
||||
if (defaultSearchEdit != nullptr) {
|
||||
defaultSearchEdit->clearText();
|
||||
} else {
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
macosSearchEdit->clearText();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,9 +47,9 @@ void YACReaderLibrarySearchEdit::setDisabled(bool disabled)
|
||||
if (defaultSearchEdit != nullptr) {
|
||||
defaultSearchEdit->setDisabled(disabled);
|
||||
} else {
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
macosSearchEdit->setDisabled(disabled);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,9 +58,9 @@ void YACReaderLibrarySearchEdit::setEnabled(bool enabled)
|
||||
if (defaultSearchEdit != nullptr) {
|
||||
defaultSearchEdit->setEnabled(enabled);
|
||||
} else {
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
macosSearchEdit->setEnabled(enabled);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,9 +69,9 @@ QString YACReaderLibrarySearchEdit::text()
|
||||
if (defaultSearchEdit != nullptr) {
|
||||
return defaultSearchEdit->text();
|
||||
} else {
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
return macosSearchEdit->text();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
return "";
|
||||
|
@ -11,9 +11,9 @@
|
||||
#include "yacreader_macosx_toolbar.h"
|
||||
#endif
|
||||
|
||||
class YACReaderLibrarySearchEdit: public QObject
|
||||
class YACReaderLibrarySearchEdit : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
#ifdef Q_OS_MAC
|
||||
YACReaderLibrarySearchEdit(YACReaderMacOSXSearchLineEdit *searchEdit);
|
||||
|
@ -7,11 +7,11 @@
|
||||
using namespace YACReader;
|
||||
|
||||
YACReaderLibraryToolbar::YACReaderLibraryToolbar(QMainWindow *mainWindow, bool isMacosNative, bool useNativeFullScreen, QSettings *settings)
|
||||
:QObject(mainWindow), mainWindow(mainWindow), isMacosNative(isMacosNative), useNativeFullScreen(useNativeFullScreen), settings(settings)
|
||||
: QObject(mainWindow), mainWindow(mainWindow), isMacosNative(isMacosNative), useNativeFullScreen(useNativeFullScreen), settings(settings)
|
||||
{
|
||||
backAction = new QAction(mainWindow);
|
||||
QIcon icoBackButton;
|
||||
icoBackButton.addFile(":/images/main_toolbar/back.svg",QSize(), QIcon::Normal);
|
||||
icoBackButton.addFile(":/images/main_toolbar/back.svg", QSize(), QIcon::Normal);
|
||||
//icoBackButton.addPixmap(QPixmap(":/images/main_toolbar/back_disabled.svg"), QIcon::Disabled);
|
||||
backAction->setData(BACK_ACTION_YL);
|
||||
backAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(BACK_ACTION_YL));
|
||||
@ -42,13 +42,13 @@ YACReaderLibraryToolbar::YACReaderLibraryToolbar(QMainWindow *mainWindow, bool i
|
||||
icoServerButton.addFile(":/images/main_toolbar/server.svg", QSize(), QIcon::Normal);
|
||||
serverConfigAction->setIcon(icoServerButton);
|
||||
|
||||
toggleComicsViewAction = new QAction(tr("Change between comics views"),mainWindow);
|
||||
toggleComicsViewAction = new QAction(tr("Change between comics views"), mainWindow);
|
||||
toggleComicsViewAction->setToolTip(tr("Change between comics views"));
|
||||
QIcon icoViewsButton;
|
||||
|
||||
if(!settings->contains(COMICS_VIEW_STATUS) || settings->value(COMICS_VIEW_STATUS) == Flow)
|
||||
if (!settings->contains(COMICS_VIEW_STATUS) || settings->value(COMICS_VIEW_STATUS) == Flow)
|
||||
icoViewsButton.addFile(":/images/main_toolbar/grid.svg", QSize(), QIcon::Normal);
|
||||
else if(settings->value(COMICS_VIEW_STATUS) == Grid)
|
||||
else if (settings->value(COMICS_VIEW_STATUS) == Grid)
|
||||
icoViewsButton.addFile(":/images/main_toolbar/info.svg", QSize(), QIcon::Normal);
|
||||
else
|
||||
icoViewsButton.addFile(":/images/main_toolbar/flow.svg", QSize(), QIcon::Normal);
|
||||
@ -62,11 +62,11 @@ YACReaderLibraryToolbar::YACReaderLibraryToolbar(QMainWindow *mainWindow, bool i
|
||||
helpAboutAction->setData(HELP_ABOUT_ACTION_YL);
|
||||
helpAboutAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(HELP_ABOUT_ACTION_YL));
|
||||
QIcon icoHelpButton;
|
||||
icoHelpButton.addFile(":/images/main_toolbar/help.svg",QSize(), QIcon::Normal);
|
||||
icoHelpButton.addFile(":/images/main_toolbar/help.svg", QSize(), QIcon::Normal);
|
||||
helpAboutAction->setIcon(icoHelpButton);
|
||||
|
||||
if (!useNativeFullScreen) {
|
||||
toggleFullScreenAction = new QAction(tr("Fullscreen mode on/off"),mainWindow);
|
||||
toggleFullScreenAction = new QAction(tr("Fullscreen mode on/off"), mainWindow);
|
||||
toggleFullScreenAction->setToolTip(tr("Fullscreen mode on/off"));
|
||||
toggleFullScreenAction->setData(TOGGLE_FULL_SCREEN_ACTION_YL);
|
||||
toggleFullScreenAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(TOGGLE_FULL_SCREEN_ACTION_YL));
|
||||
|
@ -10,23 +10,23 @@
|
||||
|
||||
#include "yacreader_library_search_edit.h"
|
||||
|
||||
class YACReaderLibraryToolbar: public QObject
|
||||
class YACReaderLibraryToolbar : public QObject
|
||||
{
|
||||
public:
|
||||
YACReaderLibraryToolbar(QMainWindow *mainWindow, bool isMacosNative, bool useNativeFullScreen, QSettings *settings);
|
||||
|
||||
QWidget * widget() { return defaultToolbar; }
|
||||
QWidget *widget() { return defaultToolbar; }
|
||||
|
||||
QAction * backAction;
|
||||
QAction * forwardAction;
|
||||
QAction *backAction;
|
||||
QAction *forwardAction;
|
||||
|
||||
QAction * optionsAction;
|
||||
QAction * serverConfigAction;
|
||||
QAction * toggleComicsViewAction;
|
||||
QAction *optionsAction;
|
||||
QAction *serverConfigAction;
|
||||
QAction *toggleComicsViewAction;
|
||||
|
||||
QAction * helpAboutAction;
|
||||
QAction *helpAboutAction;
|
||||
|
||||
QAction * toggleFullScreenAction = nullptr;
|
||||
QAction *toggleFullScreenAction = nullptr;
|
||||
|
||||
YACReaderLibrarySearchEdit *searchEdit;
|
||||
public slots:
|
||||
@ -43,15 +43,13 @@ private:
|
||||
QMainWindow *mainWindow;
|
||||
bool isMacosNative;
|
||||
bool useNativeFullScreen;
|
||||
QSettings * settings;
|
||||
QSettings *settings;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
YACReaderMacOSXToolbar *macosxToolbar = nullptr;
|
||||
#endif
|
||||
|
||||
YACReaderMainToolBar *defaultToolbar = nullptr;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // YACREADER_LIBRARY_TOOLBAR_H
|
||||
|
@ -132,7 +132,7 @@ void YACReaderMainToolBar::addWideDivider()
|
||||
mainLayout->addSpacing(3);
|
||||
}
|
||||
|
||||
void YACReaderMainToolBar::setTitle(const QString & name)
|
||||
void YACReaderMainToolBar::setTitle(const QString &name)
|
||||
{
|
||||
currentFolder->setText(name);
|
||||
currentFolderName = name;
|
||||
|
@ -24,7 +24,7 @@ signals:
|
||||
public slots:
|
||||
void select();
|
||||
void deselect();
|
||||
void setName(const QString & name);
|
||||
void setName(const QString &name);
|
||||
|
||||
private:
|
||||
QLabel *icon;
|
||||
|
@ -29,7 +29,7 @@ YACReaderSearchLineEdit::YACReaderSearchLineEdit(QWidget *parent)
|
||||
clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
|
||||
clearButton->hide();
|
||||
connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
|
||||
connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateCloseButton(const QString&)));
|
||||
connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(updateCloseButton(const QString &)));
|
||||
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
|
||||
|
||||
setStyleSheet(QString("QLineEdit {color: #ABABAB; border:none; border-radius: 4px; background-color:#404040; padding-left: %1px; padding-right: %2px; padding-bottom: 1px; margin-right: 9px;} ").arg(searchLabel->sizeHint().width() + frameWidth + 6 + 5).arg(clearButton->sizeHint().width() + frameWidth + 2));
|
||||
|
@ -60,7 +60,7 @@ YACReaderSideBar::YACReaderSideBar(QWidget *parent)
|
||||
l->addSpacing(3);
|
||||
}
|
||||
|
||||
l->addWidget(selectedLibrary);
|
||||
l->addWidget(selectedLibrary);
|
||||
|
||||
if (!theme.isMacosNative) {
|
||||
l->addSpacing(11);
|
||||
|
@ -41,7 +41,7 @@ public slots:
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *);
|
||||
void closeEvent ( QCloseEvent * event );
|
||||
void closeEvent(QCloseEvent *event);
|
||||
QSettings *settings;
|
||||
QSplitter *splitter;
|
||||
Theme theme = Theme::currentTheme();
|
||||
|
@ -88,7 +88,7 @@ YACReaderTitledToolBar::YACReaderTitledToolBar(const QString &title, QWidget *pa
|
||||
|
||||
void YACReaderTitledToolBar::addAction(QAction *action)
|
||||
{
|
||||
auto mainLayout = dynamic_cast<QHBoxLayout *>(layout());
|
||||
auto mainLayout = dynamic_cast<QHBoxLayout *>(layout());
|
||||
|
||||
auto tb = new QToolButton(this);
|
||||
tb->setCursor(QCursor(Qt::ArrowCursor));
|
||||
|
@ -25,7 +25,7 @@ private:
|
||||
QColor dropShadowColor;
|
||||
QColor textColor;
|
||||
void drawText(QPainter *painter, QPoint offset);
|
||||
void drawTextEffect(QPainter* painter, QPoint offset);
|
||||
void drawTextEffect(QPainter *painter, QPoint offset);
|
||||
|
||||
Theme theme = Theme::currentTheme();
|
||||
};
|
||||
@ -44,7 +44,7 @@ public slots:
|
||||
void addSepartor();
|
||||
|
||||
private:
|
||||
DropShadowLabel * nameLabel;
|
||||
DropShadowLabel *nameLabel;
|
||||
Theme theme = Theme::currentTheme();
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include "theme.h"
|
||||
|
||||
|
||||
YACReaderTreeView::YACReaderTreeView(QWidget *parent)
|
||||
: QTreeView(parent)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user