VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIScaleFactorEditor.h@ 74722

Last change on this file since 74722 was 74722, checked in by vboxsync, 6 years ago

bugref:9255. Switch to the new scale factor widget in vm settings dialog

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
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: */
30class QComboBox;
31class QGridLayout;
32class QSpinBox;
33class QWidget;
34class QIAdvancedSlider;
35
36/** QWidget reimplementation
37 * providing GUI with monitor scale factor editing functionality. */
38class SHARED_LIBRARY_STUFF UIScaleFactorEditor : public QIWithRetranslateUI<QWidget>
39{
40 Q_OBJECT;
41
42signals:
43
44public:
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
52protected:
53 virtual void retranslateUi() /* override */;
54
55private slots:
56 void sltScaleSpinBoxValueChanged(int value);
57 void sltScaleSliderValueChanged(int value);
58 void sltMonitorComboIndexChanged(int index);
59
60private:
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___ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette