1 | /* $Id: UIScaleFactorEditor.h 74722 2018-10-09 17:08:55Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIScaleFactorEditor class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-2017 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___UIScaleFactorEditor_h___
|
---|
19 | #define ___UIScaleFactorEditor_h___
|
---|
20 |
|
---|
21 | /* Qt includes: */
|
---|
22 | //# include <QWidget>
|
---|
23 |
|
---|
24 | /* GUI includes: */
|
---|
25 | #include "QIWithRetranslateUI.h"
|
---|
26 | #include "UILibraryDefs.h"
|
---|
27 |
|
---|
28 |
|
---|
29 | /* Forward declarations: */
|
---|
30 | class QComboBox;
|
---|
31 | class QGridLayout;
|
---|
32 | class QSpinBox;
|
---|
33 | class QWidget;
|
---|
34 | class QIAdvancedSlider;
|
---|
35 |
|
---|
36 | /** QWidget reimplementation
|
---|
37 | * providing GUI with monitor scale factor editing functionality. */
|
---|
38 | class SHARED_LIBRARY_STUFF UIScaleFactorEditor : public QIWithRetranslateUI<QWidget>
|
---|
39 | {
|
---|
40 | Q_OBJECT;
|
---|
41 |
|
---|
42 | signals:
|
---|
43 |
|
---|
44 | public:
|
---|
45 |
|
---|
46 | /** Constructor, passes @a pParent to the QWidget constructor.*/
|
---|
47 | UIScaleFactorEditor(QWidget *pParent);
|
---|
48 | void setMonitorCount(int iMonitorCount);
|
---|
49 | void setScaleFactors(const QList<double> &scaleFactors);
|
---|
50 | const QList<double>& scaleFactors() const;
|
---|
51 |
|
---|
52 | protected:
|
---|
53 | virtual void retranslateUi() /* override */;
|
---|
54 |
|
---|
55 | private slots:
|
---|
56 | void sltScaleSpinBoxValueChanged(int value);
|
---|
57 | void sltScaleSliderValueChanged(int value);
|
---|
58 | void sltMonitorComboIndexChanged(int index);
|
---|
59 |
|
---|
60 | private:
|
---|
61 | void prepare();
|
---|
62 | void setScaleFactor(int iMonitorIndex, int iScaleFactor);
|
---|
63 | void setSliderValue(int iValue);
|
---|
64 | void setSpinBoxValue(int iValue);
|
---|
65 | QSpinBox *m_pScaleSpinBox;
|
---|
66 | QGridLayout *m_pMainLayout;
|
---|
67 | QComboBox *m_pMonitorComboBox;
|
---|
68 | QIAdvancedSlider *m_pScaleSlider;
|
---|
69 | /* Stores the per-monitor scale factors in range [.., 1, ..] */
|
---|
70 | QList<double> m_scaleFactors;
|
---|
71 | };
|
---|
72 |
|
---|
73 | #endif /* !___UIScaleFactorEditor_h___ */
|
---|