pass over AppearancePage to fit to the removal of tool buttons

This commit is contained in:
csoler 2017-02-15 21:50:53 +01:00
parent 7c8f8efbad
commit 3c75135f91
3 changed files with 60 additions and 143 deletions

View file

@ -86,7 +86,7 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
} }
connect(ui.cmboTollButtonsSize, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboToolButtonSize() )); connect(ui.cmboTollButtonsSize, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboToolButtonSize() ));
connect(ui.cmboListItemSize, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboListItemSize() )); // connect(ui.cmboListItemSize, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboListItemSize() ));
connect(ui.cmboTollButtonsStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboToolButtonStyle())); connect(ui.cmboTollButtonsStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboToolButtonStyle()));
connect(ui.cmboLanguage, SIGNAL(currentIndexChanged(int)), this, SLOT(updateLanguageCode() )); connect(ui.cmboLanguage, SIGNAL(currentIndexChanged(int)), this, SLOT(updateLanguageCode() ));
connect(ui.cmboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateInterfaceStyle() )); connect(ui.cmboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateInterfaceStyle() ));
@ -94,7 +94,7 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this, SLOT(updateStatusToolTip() )); connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this, SLOT(updateStatusToolTip() ));
connect(ui.mainPageButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateRbtPageOnToolBar() )); connect(ui.mainPageButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateRbtPageOnToolBar() ));
connect(ui.menuItemsButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateActionButtonLoc() )); // connect(ui.menuItemsButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateActionButtonLoc() ));
} }
void AppearancePage::switch_status_grpStatus(bool b) { switch_status(MainWindow::StatusGrpStatus ,"ShowStatusBar", b) ; } void AppearancePage::switch_status_grpStatus(bool b) { switch_status(MainWindow::StatusGrpStatus ,"ShowStatusBar", b) ; }
@ -133,11 +133,7 @@ void AppearancePage::updateSheetName() { Settings->setSheetName(ui.cmboSt
void AppearancePage::updateRbtPageOnToolBar() void AppearancePage::updateRbtPageOnToolBar()
{ {
Settings->setPageButtonLoc(!ui.mainPageButtonType_CB->currentIndex()); Settings->setPageButtonLoc(!ui.mainPageButtonType_CB->currentIndex());
NotifyQt::getInstance()->notifySettingsChanged(); Settings->setActionButtonLoc(!ui.mainPageButtonType_CB->currentIndex());
}
void AppearancePage::updateActionButtonLoc()
{
Settings->setActionButtonLoc(!ui.menuItemsButtonType_CB->currentIndex());
NotifyQt::getInstance()->notifySettingsChanged(); NotifyQt::getInstance()->notifySettingsChanged();
} }
void AppearancePage::updateStatusToolTip() { MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked()); } void AppearancePage::updateStatusToolTip() { MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked()); }
@ -168,50 +164,56 @@ void AppearancePage::updateCmboToolButtonSize()
{ {
case 0: case 0:
Settings->setToolButtonSize(8); Settings->setToolButtonSize(8);
break;
case 1:
Settings->setToolButtonSize(16);
break;
case 2:
default:
Settings->setToolButtonSize(24);
break;
case 3:
Settings->setToolButtonSize(32);
break;
case 4:
Settings->setToolButtonSize(64);
break;
case 5:
Settings->setToolButtonSize(128);
}
NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateCmboListItemSize()
{
switch (ui.cmboListItemSize->currentIndex())
{
case 0:
Settings->setListItemIconSize(8); Settings->setListItemIconSize(8);
break; break;
case 1: case 1:
Settings->setToolButtonSize(16);
Settings->setListItemIconSize(16); Settings->setListItemIconSize(16);
break; break;
case 2: case 2:
default: default:
Settings->setToolButtonSize(24);
Settings->setListItemIconSize(24); Settings->setListItemIconSize(24);
break; break;
case 3: case 3:
Settings->setToolButtonSize(32);
Settings->setListItemIconSize(32); Settings->setListItemIconSize(32);
break; break;
case 4: case 4:
Settings->setToolButtonSize(64);
Settings->setListItemIconSize(64); Settings->setListItemIconSize(64);
break; break;
case 5: case 5:
Settings->setToolButtonSize(128);
Settings->setListItemIconSize(128); Settings->setListItemIconSize(128);
} }
NotifyQt::getInstance()->notifySettingsChanged(); NotifyQt::getInstance()->notifySettingsChanged();
} }
// void AppearancePage::updateCmboListItemSize()
// {
// switch (ui.cmboListItemSize->currentIndex())
// {
// case 0:
// Settings->setListItemIconSize(8);
// break;
// case 1:
// Settings->setListItemIconSize(16);
// break;
// case 2:
// default:
// Settings->setListItemIconSize(24);
// break;
// case 3:
// Settings->setListItemIconSize(32);
// break;
// case 4:
// Settings->setListItemIconSize(64);
// break;
// case 5:
// Settings->setListItemIconSize(128);
// }
// NotifyQt::getInstance()->notifySettingsChanged();
// }
void AppearancePage::updateStyle() { Rshare::setStyle(ui.cmboStyle->currentText()); } void AppearancePage::updateStyle() { Rshare::setStyle(ui.cmboStyle->currentText()); }
@ -232,7 +234,7 @@ void AppearancePage::load()
ui.cmboStyleSheet->setCurrentIndex(index); ui.cmboStyleSheet->setCurrentIndex(index);
ui.mainPageButtonType_CB->setCurrentIndex(!Settings->getPageButtonLoc()); ui.mainPageButtonType_CB->setCurrentIndex(!Settings->getPageButtonLoc());
ui.menuItemsButtonType_CB->setCurrentIndex(!Settings->getActionButtonLoc()); // ui.menuItemsButtonType_CB->setCurrentIndex(!Settings->getActionButtonLoc());
switch (Settings->getToolButtonStyle()) switch (Settings->getToolButtonStyle())
{ {
@ -270,27 +272,27 @@ void AppearancePage::load()
case 128: case 128:
ui.cmboTollButtonsSize->setCurrentIndex(5); ui.cmboTollButtonsSize->setCurrentIndex(5);
} }
switch (Settings->getListItemIconSize()) // switch (Settings->getListItemIconSize())
{ // {
case 8: // case 8:
ui.cmboListItemSize->setCurrentIndex(0); // ui.cmboListItemSize->setCurrentIndex(0);
break; // break;
case 16: // case 16:
ui.cmboListItemSize->setCurrentIndex(1); // ui.cmboListItemSize->setCurrentIndex(1);
break; // break;
case 24: // case 24:
default: // default:
ui.cmboListItemSize->setCurrentIndex(2); // ui.cmboListItemSize->setCurrentIndex(2);
break; // break;
case 32: // case 32:
ui.cmboListItemSize->setCurrentIndex(3); // ui.cmboListItemSize->setCurrentIndex(3);
break; // break;
case 64: // case 64:
ui.cmboListItemSize->setCurrentIndex(4); // ui.cmboListItemSize->setCurrentIndex(4);
break; // break;
case 128: // case 128:
ui.cmboListItemSize->setCurrentIndex(5); // ui.cmboListItemSize->setCurrentIndex(5);
} // }
ui.grpStatus->setChecked(Settings->valueFromGroup("StatusBar", "ShowStatusBar", QVariant(true)).toBool()); ui.grpStatus->setChecked(Settings->valueFromGroup("StatusBar", "ShowStatusBar", QVariant(true)).toBool());
ui.checkBoxStatusCompactMode->setChecked(Settings->valueFromGroup("StatusBar", "CompactMode", QVariant(false)).toBool()); ui.checkBoxStatusCompactMode->setChecked(Settings->valueFromGroup("StatusBar", "CompactMode", QVariant(false)).toBool());

View file

@ -62,12 +62,12 @@ private slots:
void updateInterfaceStyle() ; void updateInterfaceStyle() ;
void updateSheetName() ; void updateSheetName() ;
void updateRbtPageOnToolBar(); void updateRbtPageOnToolBar();
void updateActionButtonLoc() ; // void updateActionButtonLoc() ;
void updateStatusToolTip() ; void updateStatusToolTip() ;
void updateCmboToolButtonStyle(); void updateCmboToolButtonStyle();
void updateCmboToolButtonSize(); void updateCmboToolButtonSize();
void updateCmboListItemSize(); // void updateCmboListItemSize();
void updateStyle() ; void updateStyle() ;
private: private:

View file

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1160</width> <width>1170</width>
<height>897</height> <height>897</height>
</rect> </rect>
</property> </property>
@ -237,44 +237,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="labelActionToolBar">
<property name="text">
<string>Menu items:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="menuItemsButtonType_CB">
<item>
<property name="text">
<string>Buttons</string>
</property>
</item>
<item>
<property name="text">
<string>Item list</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="frameActionHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>300</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item> <item>
<widget class="QFrame" name="frameToolListStyle"> <widget class="QFrame" name="frameToolListStyle">
<property name="sizePolicy"> <property name="sizePolicy">
@ -324,19 +286,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="QLabel" name="labelListItemStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Choose the style of List Items.</string>
</property>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QComboBox" name="cmboTollButtonsSize"> <widget class="QComboBox" name="cmboTollButtonsSize">
<item> <item>
@ -371,40 +320,6 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<widget class="QComboBox" name="cmboListItemSize">
<item>
<property name="text">
<string>Icon Size = 8x8</string>
</property>
</item>
<item>
<property name="text">
<string>Icon Size = 16x16</string>
</property>
</item>
<item>
<property name="text">
<string>Icon Size = 24x24</string>
</property>
</item>
<item>
<property name="text">
<string>Icon Size = 32x32</string>
</property>
</item>
<item>
<property name="text">
<string>Icon Size = 64x64</string>
</property>
</item>
<item>
<property name="text">
<string>Icon Size = 128x128</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>