blob: 1a16ed243fa62b5085d1f14dee80bb828efb297a [file] [log] [blame]
chudy@google.com902ebe52012-06-29 14:21:22 +00001
2/*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10#ifndef SKSETTINGSWIDGET_H_
11#define SKSETTINGSWIDGET_H_
12
13#include <QWidget>
14#include <QHBoxLayout>
15#include <QTextEdit>
16#include <QFrame>
17#include <QLabel>
18#include <QRadioButton>
19#include <QCheckBox>
chudy@google.com7dcae672012-07-09 20:26:53 +000020#include <QLineEdit>
chudy@google.com902ebe52012-06-29 14:21:22 +000021
22/** \class SkSettingsWidget
23
24 The SettingsWidget contains multiple checkboxes and toggles for altering
25 the visibility.
26 */
27class SkSettingsWidget : public QWidget {
28 Q_OBJECT
29
30public:
31 /**
32 Constructs a widget with the specified parent for layout purposes.
33 @param parent The parent container of this widget
34 */
chudy@google.com2d537a12012-07-31 12:49:52 +000035 SkSettingsWidget();
chudy@google.com902ebe52012-06-29 14:21:22 +000036
bungeman@google.come8cc6e82013-01-17 16:30:56 +000037 /** Sets the displayed user zoom level. A scale of 1.0 represents no zoom. */
38 void setZoomText(float scale);
chudy@google.com7dcae672012-07-09 20:26:53 +000039
chudy@google.com7dcae672012-07-09 20:26:53 +000040 QRadioButton* getVisibilityButton();
41
robertphillips@google.come8fe4bc2013-02-13 13:26:13 +000042#if SK_SUPPORT_GPU
chudy@google.comea5488b2012-07-26 19:38:22 +000043 QCheckBox* getGLCheckBox() {
44 return &fGLCheckBox;
45 }
robertphillips@google.come8fe4bc2013-02-13 13:26:13 +000046#endif
chudy@google.comea5488b2012-07-26 19:38:22 +000047
48 QCheckBox* getRasterCheckBox() {
49 return &fRasterCheckBox;
50 }
51
robertphillips@google.comf4741c12013-02-06 20:13:54 +000052 QCheckBox* getOverdrawVizCheckBox() {
53 return &fOverdrawVizCheckBox;
54 }
55
chudy@google.com7dcae672012-07-09 20:26:53 +000056private slots:
57 void updateCommand(int newCommand);
chudy@google.come606d6e2012-07-12 14:31:25 +000058 void updateHit(int newHit);
chudy@google.com7dcae672012-07-09 20:26:53 +000059
60signals:
61 void scrollingPreferences(bool isStickyActivate);
62 void showStyle(bool isSingleCommand);
63 void visibilityFilter(bool isEnabled);
64
chudy@google.com902ebe52012-06-29 14:21:22 +000065private:
chudy@google.com7dcae672012-07-09 20:26:53 +000066 QVBoxLayout mainFrameLayout;
67 QFrame mainFrame;
68 QVBoxLayout fVerticalLayout;
chudy@google.com902ebe52012-06-29 14:21:22 +000069
chudy@google.com7dcae672012-07-09 20:26:53 +000070 QLabel fVisibileText;
71 QFrame fVisibleFrame;
72 QVBoxLayout fVisibleFrameLayout;
73 QRadioButton fVisibleOn;
74 QRadioButton fVisibleOff;
chudy@google.com902ebe52012-06-29 14:21:22 +000075
chudy@google.com7dcae672012-07-09 20:26:53 +000076 QLabel fCommandToggle;
77 QFrame fCommandFrame;
78 QVBoxLayout fCommandLayout;
chudy@google.com902ebe52012-06-29 14:21:22 +000079
chudy@google.com2d537a12012-07-31 12:49:52 +000080 QHBoxLayout fCurrentCommandLayout;
chudy@google.com7dcae672012-07-09 20:26:53 +000081 QLabel fCurrentCommandLabel;
chudy@google.come606d6e2012-07-12 14:31:25 +000082 QLineEdit fCurrentCommandBox;
chudy@google.com902ebe52012-06-29 14:21:22 +000083
chudy@google.com2d537a12012-07-31 12:49:52 +000084 QHBoxLayout fCommandHitLayout;
chudy@google.come606d6e2012-07-12 14:31:25 +000085 QLabel fCommandHitLabel;
86 QLineEdit fCommandHitBox;
chudy@google.come606d6e2012-07-12 14:31:25 +000087
chudy@google.comea5488b2012-07-26 19:38:22 +000088 QFrame fCanvasFrame;
89 QVBoxLayout fCanvasLayout;
chudy@google.com2d537a12012-07-31 12:49:52 +000090 QLabel fCanvasToggle;
chudy@google.comea5488b2012-07-26 19:38:22 +000091
92 QHBoxLayout fRasterLayout;
93 QLabel fRasterLabel;
94 QCheckBox fRasterCheckBox;
95
robertphillips@google.comf4741c12013-02-06 20:13:54 +000096 QHBoxLayout fOverdrawVizLayout;
97 QLabel fOverdrawVizLabel;
98 QCheckBox fOverdrawVizCheckBox;
99
robertphillips@google.come8fe4bc2013-02-13 13:26:13 +0000100#if SK_SUPPORT_GPU
chudy@google.comea5488b2012-07-26 19:38:22 +0000101 QHBoxLayout fGLLayout;
102 QLabel fGLLabel;
103 QCheckBox fGLCheckBox;
robertphillips@google.come8fe4bc2013-02-13 13:26:13 +0000104#endif
chudy@google.comea5488b2012-07-26 19:38:22 +0000105
chudy@google.com7dcae672012-07-09 20:26:53 +0000106 QFrame fZoomFrame;
chudy@google.com7dcae672012-07-09 20:26:53 +0000107 QHBoxLayout fZoomLayout;
chudy@google.com2d537a12012-07-31 12:49:52 +0000108 QLabel fZoomSetting;
109 QLineEdit fZoomBox;
chudy@google.com902ebe52012-06-29 14:21:22 +0000110};
111
112#endif /* SKSETTINGSWIDGET_H_ */