mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
qt: Introduce PlatformStyle
Introduce a PlatformStyle to handle platform-specific customization of the UI. This replaces 'scicon', as well as #ifdefs to determine whether to place icons on buttons. The selected PlatformStyle defaults to the platform that the application was compiled on, but can be overridden from the command line with `-uiplatform=<x>`. Also fixes the warning from #6328.
This commit is contained in:
@@ -14,14 +14,14 @@
|
||||
#include "csvmodelwriter.h"
|
||||
#include "editaddressdialog.h"
|
||||
#include "guiutil.h"
|
||||
#include "scicon.h"
|
||||
#include "platformstyle.h"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
|
||||
AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::AddressBookPage),
|
||||
model(0),
|
||||
@@ -30,17 +30,17 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
|
||||
ui->newAddress->setIcon(QIcon());
|
||||
ui->copyAddress->setIcon(QIcon());
|
||||
ui->deleteAddress->setIcon(QIcon());
|
||||
ui->exportButton->setIcon(QIcon());
|
||||
#else
|
||||
ui->newAddress->setIcon(SingleColorIcon(":/icons/add"));
|
||||
ui->copyAddress->setIcon(SingleColorIcon(":/icons/editcopy"));
|
||||
ui->deleteAddress->setIcon(SingleColorIcon(":/icons/remove"));
|
||||
ui->exportButton->setIcon(SingleColorIcon(":/icons/export"));
|
||||
#endif
|
||||
if (!platformStyle->getImagesOnButtons()) {
|
||||
ui->newAddress->setIcon(QIcon());
|
||||
ui->copyAddress->setIcon(QIcon());
|
||||
ui->deleteAddress->setIcon(QIcon());
|
||||
ui->exportButton->setIcon(QIcon());
|
||||
} else {
|
||||
ui->newAddress->setIcon(platformStyle->SingleColorIcon(":/icons/add"));
|
||||
ui->copyAddress->setIcon(platformStyle->SingleColorIcon(":/icons/editcopy"));
|
||||
ui->deleteAddress->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
|
||||
ui->exportButton->setIcon(platformStyle->SingleColorIcon(":/icons/export"));
|
||||
}
|
||||
|
||||
switch(mode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user