2012-06-29 14:21:22 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2012 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef SKSETTINGSWIDGET_H_
|
|
|
|
#define SKSETTINGSWIDGET_H_
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QTextEdit>
|
|
|
|
#include <QFrame>
|
2013-08-02 13:59:50 +00:00
|
|
|
#include <QGroupBox>
|
2012-06-29 14:21:22 +00:00
|
|
|
#include <QLabel>
|
|
|
|
#include <QCheckBox>
|
2012-07-09 20:26:53 +00:00
|
|
|
#include <QLineEdit>
|
2013-11-21 15:37:29 +00:00
|
|
|
#include <QComboBox>
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2013-10-17 17:56:10 +00:00
|
|
|
#include "SkPaint.h"
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/** \class SkSettingsWidget
|
|
|
|
|
|
|
|
The SettingsWidget contains multiple checkboxes and toggles for altering
|
|
|
|
the visibility.
|
|
|
|
*/
|
|
|
|
class SkSettingsWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructs a widget with the specified parent for layout purposes.
|
|
|
|
@param parent The parent container of this widget
|
|
|
|
*/
|
2012-07-31 12:49:52 +00:00
|
|
|
SkSettingsWidget();
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2013-01-17 16:30:56 +00:00
|
|
|
/** Sets the displayed user zoom level. A scale of 1.0 represents no zoom. */
|
|
|
|
void setZoomText(float scale);
|
2012-07-09 20:26:53 +00:00
|
|
|
|
2013-11-21 15:37:29 +00:00
|
|
|
bool getVisibilityFilter() const {
|
|
|
|
return fVisibilityCombo.itemData(fVisibilityCombo.currentIndex()).toBool();
|
|
|
|
}
|
2012-07-09 20:26:53 +00:00
|
|
|
|
2013-02-13 13:26:13 +00:00
|
|
|
#if SK_SUPPORT_GPU
|
2013-11-21 15:37:29 +00:00
|
|
|
bool isGLActive() const {
|
2013-08-02 13:59:50 +00:00
|
|
|
return fGLCheckBox.isChecked();
|
2012-07-26 19:38:22 +00:00
|
|
|
}
|
2013-08-02 13:59:50 +00:00
|
|
|
|
2013-11-21 15:37:29 +00:00
|
|
|
int getGLSampleCount() const {
|
|
|
|
return fGLMSAACombo.itemData(fGLMSAACombo.currentIndex()).toInt();
|
2013-08-02 13:59:50 +00:00
|
|
|
}
|
|
|
|
|
2013-02-13 13:26:13 +00:00
|
|
|
#endif
|
2012-07-26 19:38:22 +00:00
|
|
|
|
2013-11-21 15:37:29 +00:00
|
|
|
bool getFilterOverride(SkPaint::FilterLevel* filterLevel) const {
|
|
|
|
int index = fFilterCombo.currentIndex();
|
|
|
|
*filterLevel = (SkPaint::FilterLevel)fFilterCombo.itemData(index).toUInt();
|
|
|
|
|
|
|
|
return index > 0;
|
2013-10-17 17:56:10 +00:00
|
|
|
}
|
|
|
|
|
2012-07-26 19:38:22 +00:00
|
|
|
QCheckBox* getRasterCheckBox() {
|
|
|
|
return &fRasterCheckBox;
|
|
|
|
}
|
|
|
|
|
2013-02-06 20:13:54 +00:00
|
|
|
QCheckBox* getOverdrawVizCheckBox() {
|
|
|
|
return &fOverdrawVizCheckBox;
|
|
|
|
}
|
|
|
|
|
2014-03-03 16:32:17 +00:00
|
|
|
QCheckBox* getMegaVizCheckBox() {
|
|
|
|
return &fMegaVizCheckBox;
|
|
|
|
}
|
|
|
|
|
2014-05-19 13:53:10 +00:00
|
|
|
QCheckBox* getPathOpsCheckBox() {
|
|
|
|
return &fPathOpsCheckBox;
|
|
|
|
}
|
|
|
|
|
2012-07-09 20:26:53 +00:00
|
|
|
private slots:
|
|
|
|
void updateCommand(int newCommand);
|
2012-07-12 14:31:25 +00:00
|
|
|
void updateHit(int newHit);
|
2012-07-09 20:26:53 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void scrollingPreferences(bool isStickyActivate);
|
|
|
|
void showStyle(bool isSingleCommand);
|
2013-11-21 15:37:29 +00:00
|
|
|
void visibilityFilterChanged();
|
2013-10-17 17:56:10 +00:00
|
|
|
void texFilterSettingsChanged();
|
2013-08-02 13:59:50 +00:00
|
|
|
#if SK_SUPPORT_GPU
|
|
|
|
void glSettingsChanged();
|
|
|
|
#endif
|
2012-07-09 20:26:53 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2012-07-09 20:26:53 +00:00
|
|
|
QVBoxLayout mainFrameLayout;
|
|
|
|
QFrame mainFrame;
|
|
|
|
QVBoxLayout fVerticalLayout;
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2013-11-21 15:37:29 +00:00
|
|
|
QLabel fVisibleText;
|
2012-07-09 20:26:53 +00:00
|
|
|
QFrame fVisibleFrame;
|
|
|
|
QVBoxLayout fVisibleFrameLayout;
|
2013-11-21 15:37:29 +00:00
|
|
|
QComboBox fVisibilityCombo;
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2012-07-09 20:26:53 +00:00
|
|
|
QLabel fCommandToggle;
|
|
|
|
QFrame fCommandFrame;
|
|
|
|
QVBoxLayout fCommandLayout;
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2012-07-31 12:49:52 +00:00
|
|
|
QHBoxLayout fCurrentCommandLayout;
|
2012-07-09 20:26:53 +00:00
|
|
|
QLabel fCurrentCommandLabel;
|
2012-07-12 14:31:25 +00:00
|
|
|
QLineEdit fCurrentCommandBox;
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2012-07-31 12:49:52 +00:00
|
|
|
QHBoxLayout fCommandHitLayout;
|
2012-07-12 14:31:25 +00:00
|
|
|
QLabel fCommandHitLabel;
|
|
|
|
QLineEdit fCommandHitBox;
|
|
|
|
|
2012-07-26 19:38:22 +00:00
|
|
|
QFrame fCanvasFrame;
|
|
|
|
QVBoxLayout fCanvasLayout;
|
2012-07-31 12:49:52 +00:00
|
|
|
QLabel fCanvasToggle;
|
2012-07-26 19:38:22 +00:00
|
|
|
|
|
|
|
QHBoxLayout fRasterLayout;
|
|
|
|
QLabel fRasterLabel;
|
|
|
|
QCheckBox fRasterCheckBox;
|
|
|
|
|
2014-03-03 16:32:17 +00:00
|
|
|
QHBoxLayout fVizLayout;
|
2013-02-06 20:13:54 +00:00
|
|
|
QLabel fOverdrawVizLabel;
|
|
|
|
QCheckBox fOverdrawVizCheckBox;
|
2014-03-03 16:32:17 +00:00
|
|
|
QLabel fMegaVizLabel;
|
|
|
|
QCheckBox fMegaVizCheckBox;
|
2014-05-19 13:53:10 +00:00
|
|
|
QLabel fPathOpsLabel;
|
|
|
|
QCheckBox fPathOpsCheckBox;
|
2013-02-06 20:13:54 +00:00
|
|
|
|
2013-02-13 13:26:13 +00:00
|
|
|
#if SK_SUPPORT_GPU
|
2012-07-26 19:38:22 +00:00
|
|
|
QHBoxLayout fGLLayout;
|
|
|
|
QLabel fGLLabel;
|
|
|
|
QCheckBox fGLCheckBox;
|
2013-08-02 13:59:50 +00:00
|
|
|
QGroupBox fGLMSAAButtonGroup;
|
|
|
|
QVBoxLayout fGLMSAALayout;
|
2013-11-21 15:37:29 +00:00
|
|
|
QComboBox fGLMSAACombo;
|
2013-02-13 13:26:13 +00:00
|
|
|
#endif
|
2012-07-26 19:38:22 +00:00
|
|
|
|
2013-10-17 17:56:10 +00:00
|
|
|
// for filtering group
|
|
|
|
QGroupBox fFilterButtonGroup;
|
2013-11-21 15:37:29 +00:00
|
|
|
QComboBox fFilterCombo;
|
2013-10-17 17:56:10 +00:00
|
|
|
QVBoxLayout fFilterLayout;
|
|
|
|
|
2012-07-09 20:26:53 +00:00
|
|
|
QFrame fZoomFrame;
|
|
|
|
QHBoxLayout fZoomLayout;
|
2012-07-31 12:49:52 +00:00
|
|
|
QLabel fZoomSetting;
|
|
|
|
QLineEdit fZoomBox;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* SKSETTINGSWIDGET_H_ */
|