chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 1 | |
| 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.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 20 | #include <QLineEdit> |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 21 | |
| 22 | /** \class SkSettingsWidget |
| 23 | |
| 24 | The SettingsWidget contains multiple checkboxes and toggles for altering |
| 25 | the visibility. |
| 26 | */ |
| 27 | class SkSettingsWidget : public QWidget { |
| 28 | Q_OBJECT |
| 29 | |
| 30 | public: |
| 31 | /** |
| 32 | Constructs a widget with the specified parent for layout purposes. |
| 33 | @param parent The parent container of this widget |
| 34 | */ |
chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 35 | SkSettingsWidget(); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 36 | |
bungeman@google.com | e8cc6e8 | 2013-01-17 16:30:56 +0000 | [diff] [blame] | 37 | /** Sets the displayed user zoom level. A scale of 1.0 represents no zoom. */ |
| 38 | void setZoomText(float scale); |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 39 | |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 40 | QRadioButton* getVisibilityButton(); |
| 41 | |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 42 | #if SK_SUPPORT_GPU |
chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 43 | QCheckBox* getGLCheckBox() { |
| 44 | return &fGLCheckBox; |
| 45 | } |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 46 | #endif |
chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 47 | |
| 48 | QCheckBox* getRasterCheckBox() { |
| 49 | return &fRasterCheckBox; |
| 50 | } |
| 51 | |
robertphillips@google.com | f4741c1 | 2013-02-06 20:13:54 +0000 | [diff] [blame] | 52 | QCheckBox* getOverdrawVizCheckBox() { |
| 53 | return &fOverdrawVizCheckBox; |
| 54 | } |
| 55 | |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 56 | private slots: |
| 57 | void updateCommand(int newCommand); |
chudy@google.com | e606d6e | 2012-07-12 14:31:25 +0000 | [diff] [blame] | 58 | void updateHit(int newHit); |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 59 | |
| 60 | signals: |
| 61 | void scrollingPreferences(bool isStickyActivate); |
| 62 | void showStyle(bool isSingleCommand); |
| 63 | void visibilityFilter(bool isEnabled); |
| 64 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 65 | private: |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 66 | QVBoxLayout mainFrameLayout; |
| 67 | QFrame mainFrame; |
| 68 | QVBoxLayout fVerticalLayout; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 69 | |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 70 | QLabel fVisibileText; |
| 71 | QFrame fVisibleFrame; |
| 72 | QVBoxLayout fVisibleFrameLayout; |
| 73 | QRadioButton fVisibleOn; |
| 74 | QRadioButton fVisibleOff; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 75 | |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 76 | QLabel fCommandToggle; |
| 77 | QFrame fCommandFrame; |
| 78 | QVBoxLayout fCommandLayout; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 79 | |
chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 80 | QHBoxLayout fCurrentCommandLayout; |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 81 | QLabel fCurrentCommandLabel; |
chudy@google.com | e606d6e | 2012-07-12 14:31:25 +0000 | [diff] [blame] | 82 | QLineEdit fCurrentCommandBox; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 83 | |
chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 84 | QHBoxLayout fCommandHitLayout; |
chudy@google.com | e606d6e | 2012-07-12 14:31:25 +0000 | [diff] [blame] | 85 | QLabel fCommandHitLabel; |
| 86 | QLineEdit fCommandHitBox; |
chudy@google.com | e606d6e | 2012-07-12 14:31:25 +0000 | [diff] [blame] | 87 | |
chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 88 | QFrame fCanvasFrame; |
| 89 | QVBoxLayout fCanvasLayout; |
chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 90 | QLabel fCanvasToggle; |
chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 91 | |
| 92 | QHBoxLayout fRasterLayout; |
| 93 | QLabel fRasterLabel; |
| 94 | QCheckBox fRasterCheckBox; |
| 95 | |
robertphillips@google.com | f4741c1 | 2013-02-06 20:13:54 +0000 | [diff] [blame] | 96 | QHBoxLayout fOverdrawVizLayout; |
| 97 | QLabel fOverdrawVizLabel; |
| 98 | QCheckBox fOverdrawVizCheckBox; |
| 99 | |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 100 | #if SK_SUPPORT_GPU |
chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 101 | QHBoxLayout fGLLayout; |
| 102 | QLabel fGLLabel; |
| 103 | QCheckBox fGLCheckBox; |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 104 | #endif |
chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 105 | |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 106 | QFrame fZoomFrame; |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 107 | QHBoxLayout fZoomLayout; |
chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 108 | QLabel fZoomSetting; |
| 109 | QLineEdit fZoomBox; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 110 | }; |
| 111 | |
| 112 | #endif /* SKSETTINGSWIDGET_H_ */ |