blob: e5662ee875991b82cbccea22c0d36060a02bb9c4 [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>
commit-bot@chromium.orgfde1e7c2013-08-02 13:59:50 +000017#include <QGroupBox>
chudy@google.com902ebe52012-06-29 14:21:22 +000018#include <QLabel>
19#include <QRadioButton>
20#include <QCheckBox>
chudy@google.com7dcae672012-07-09 20:26:53 +000021#include <QLineEdit>
chudy@google.com902ebe52012-06-29 14:21:22 +000022
23/** \class SkSettingsWidget
24
25 The SettingsWidget contains multiple checkboxes and toggles for altering
26 the visibility.
27 */
28class SkSettingsWidget : public QWidget {
29 Q_OBJECT
30
31public:
32 /**
33 Constructs a widget with the specified parent for layout purposes.
34 @param parent The parent container of this widget
35 */
chudy@google.com2d537a12012-07-31 12:49:52 +000036 SkSettingsWidget();
chudy@google.com902ebe52012-06-29 14:21:22 +000037
bungeman@google.come8cc6e82013-01-17 16:30:56 +000038 /** Sets the displayed user zoom level. A scale of 1.0 represents no zoom. */
39 void setZoomText(float scale);
chudy@google.com7dcae672012-07-09 20:26:53 +000040
chudy@google.com7dcae672012-07-09 20:26:53 +000041 QRadioButton* getVisibilityButton();
42
robertphillips@google.come8fe4bc2013-02-13 13:26:13 +000043#if SK_SUPPORT_GPU
commit-bot@chromium.orgfde1e7c2013-08-02 13:59:50 +000044 bool isGLActive() {
45 return fGLCheckBox.isChecked();
chudy@google.comea5488b2012-07-26 19:38:22 +000046 }
commit-bot@chromium.orgfde1e7c2013-08-02 13:59:50 +000047
48 int getGLSampleCount() {
49 if (fGLMSAA4On.isChecked()) {
50 return 4;
51 } else if (fGLMSAA16On.isChecked()) {
52 return 16;
53 }
54 return 0;
55 }
56
robertphillips@google.come8fe4bc2013-02-13 13:26:13 +000057#endif
chudy@google.comea5488b2012-07-26 19:38:22 +000058
59 QCheckBox* getRasterCheckBox() {
60 return &fRasterCheckBox;
61 }
62
robertphillips@google.comf4741c12013-02-06 20:13:54 +000063 QCheckBox* getOverdrawVizCheckBox() {
64 return &fOverdrawVizCheckBox;
65 }
66
chudy@google.com7dcae672012-07-09 20:26:53 +000067private slots:
68 void updateCommand(int newCommand);
chudy@google.come606d6e2012-07-12 14:31:25 +000069 void updateHit(int newHit);
chudy@google.com7dcae672012-07-09 20:26:53 +000070
71signals:
72 void scrollingPreferences(bool isStickyActivate);
73 void showStyle(bool isSingleCommand);
74 void visibilityFilter(bool isEnabled);
commit-bot@chromium.orgfde1e7c2013-08-02 13:59:50 +000075#if SK_SUPPORT_GPU
76 void glSettingsChanged();
77#endif
chudy@google.com7dcae672012-07-09 20:26:53 +000078
chudy@google.com902ebe52012-06-29 14:21:22 +000079private:
chudy@google.com7dcae672012-07-09 20:26:53 +000080 QVBoxLayout mainFrameLayout;
81 QFrame mainFrame;
82 QVBoxLayout fVerticalLayout;
chudy@google.com902ebe52012-06-29 14:21:22 +000083
chudy@google.com7dcae672012-07-09 20:26:53 +000084 QLabel fVisibileText;
85 QFrame fVisibleFrame;
86 QVBoxLayout fVisibleFrameLayout;
87 QRadioButton fVisibleOn;
88 QRadioButton fVisibleOff;
chudy@google.com902ebe52012-06-29 14:21:22 +000089
chudy@google.com7dcae672012-07-09 20:26:53 +000090 QLabel fCommandToggle;
91 QFrame fCommandFrame;
92 QVBoxLayout fCommandLayout;
chudy@google.com902ebe52012-06-29 14:21:22 +000093
chudy@google.com2d537a12012-07-31 12:49:52 +000094 QHBoxLayout fCurrentCommandLayout;
chudy@google.com7dcae672012-07-09 20:26:53 +000095 QLabel fCurrentCommandLabel;
chudy@google.come606d6e2012-07-12 14:31:25 +000096 QLineEdit fCurrentCommandBox;
chudy@google.com902ebe52012-06-29 14:21:22 +000097
chudy@google.com2d537a12012-07-31 12:49:52 +000098 QHBoxLayout fCommandHitLayout;
chudy@google.come606d6e2012-07-12 14:31:25 +000099 QLabel fCommandHitLabel;
100 QLineEdit fCommandHitBox;
chudy@google.come606d6e2012-07-12 14:31:25 +0000101
chudy@google.comea5488b2012-07-26 19:38:22 +0000102 QFrame fCanvasFrame;
103 QVBoxLayout fCanvasLayout;
chudy@google.com2d537a12012-07-31 12:49:52 +0000104 QLabel fCanvasToggle;
chudy@google.comea5488b2012-07-26 19:38:22 +0000105
106 QHBoxLayout fRasterLayout;
107 QLabel fRasterLabel;
108 QCheckBox fRasterCheckBox;
109
robertphillips@google.comf4741c12013-02-06 20:13:54 +0000110 QHBoxLayout fOverdrawVizLayout;
111 QLabel fOverdrawVizLabel;
112 QCheckBox fOverdrawVizCheckBox;
113
robertphillips@google.come8fe4bc2013-02-13 13:26:13 +0000114#if SK_SUPPORT_GPU
chudy@google.comea5488b2012-07-26 19:38:22 +0000115 QHBoxLayout fGLLayout;
116 QLabel fGLLabel;
117 QCheckBox fGLCheckBox;
commit-bot@chromium.orgfde1e7c2013-08-02 13:59:50 +0000118 QGroupBox fGLMSAAButtonGroup;
119 QVBoxLayout fGLMSAALayout;
120 QRadioButton fGLMSAAOff;
121 QRadioButton fGLMSAA4On;
122 QRadioButton fGLMSAA16On;
robertphillips@google.come8fe4bc2013-02-13 13:26:13 +0000123#endif
chudy@google.comea5488b2012-07-26 19:38:22 +0000124
chudy@google.com7dcae672012-07-09 20:26:53 +0000125 QFrame fZoomFrame;
chudy@google.com7dcae672012-07-09 20:26:53 +0000126 QHBoxLayout fZoomLayout;
chudy@google.com2d537a12012-07-31 12:49:52 +0000127 QLabel fZoomSetting;
128 QLineEdit fZoomBox;
chudy@google.com902ebe52012-06-29 14:21:22 +0000129};
130
131#endif /* SKSETTINGSWIDGET_H_ */