Managed enable state of items regarding screen number

preferencesAboutTextFull
Didier Clerc 12 years ago
parent 17c42091f2
commit 20d6064f68
  1. 7
      resources/etc/Uniboard.css
  2. 8
      src/core/UBPreferencesController.cpp
  3. 5
      src/core/UBPreferencesController.h

@ -1,8 +1,13 @@
* QWidget:enabled
{ {
color: #3F3F3F; color: #3F3F3F;
} }
QWidget:disabled
{
color: #AAAAAA;
}
QTextEdit, QTextEdit,
QLineEdit, QLineEdit,
QComboBox#DockPaletteWidgetComboBox QAbstractItemView QComboBox#DockPaletteWidgetComboBox QAbstractItemView

@ -64,9 +64,12 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
, mPenProperties(0) , mPenProperties(0)
, mMarkerProperties(0) , mMarkerProperties(0)
{ {
mDesktop = qApp->desktop();
mPreferencesWindow = new UBPreferencesDialog(this,parent, Qt::Dialog); mPreferencesWindow = new UBPreferencesDialog(this,parent, Qt::Dialog);
mPreferencesUI = new Ui::preferencesDialog(); // deleted in mPreferencesUI = new Ui::preferencesDialog(); // deleted in
mPreferencesUI->setupUi(mPreferencesWindow); mPreferencesUI->setupUi(mPreferencesWindow);
adjustScreens(1);
connect(mDesktop, SIGNAL(screenCountChanged(int)), this, SLOT(adjustScreens(int)));
wire(); wire();
} }
@ -83,6 +86,11 @@ UBPreferencesController::~UBPreferencesController()
delete mMarkerProperties; delete mMarkerProperties;
} }
void UBPreferencesController::adjustScreens(int screen)
{
UBDisplayManager displayManager;
mPreferencesUI->multiDisplayGroupBox->setEnabled(displayManager.numScreens() > 1);
}
void UBPreferencesController::show() void UBPreferencesController::show()
{ {

@ -85,12 +85,15 @@ class UBPreferencesController : public QObject
void onCommunityPasswordChanged(); void onCommunityPasswordChanged();
void onCommunityPersistenceChanged(); void onCommunityPersistenceChanged();
private: private slots:
void adjustScreens(int screen);
private:
static qreal sSliderRatio; static qreal sSliderRatio;
static qreal sMinPenWidth; static qreal sMinPenWidth;
static qreal sMaxPenWidth; static qreal sMaxPenWidth;
void persistanceCheckboxUpdate(); void persistanceCheckboxUpdate();
QDesktopWidget* mDesktop;
}; };

Loading…
Cancel
Save