projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix sigrok spelling in two places.
[pulseview.git]
/
pv
/
widgets
/
colourbutton.cpp
diff --git
a/pv/widgets/colourbutton.cpp
b/pv/widgets/colourbutton.cpp
index fd417c11236d437fabaa7b40aab0952df0c43a4e..ce2ab2a9c01d6434a7cbc3f482964f980cb5b50d 100644
(file)
--- a/
pv/widgets/colourbutton.cpp
+++ b/
pv/widgets/colourbutton.cpp
@@
-14,13
+14,12
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
*/
-#include "colourbutton.h"
+#include "colourbutton.h
pp
"
-#include <
assert.h
>
+#include <
cassert
>
#include <QApplication>
#include <QPainter>
#include <QApplication>
#include <QPainter>
@@
-32,37
+31,35
@@
const int ColourButton::SwatchMargin = 7;
ColourButton::ColourButton(int rows, int cols, QWidget *parent) :
QPushButton("", parent),
ColourButton::ColourButton(int rows, int cols, QWidget *parent) :
QPushButton("", parent),
-
_popup
(rows, cols, this)
+
popup_
(rows, cols, this)
{
connect(this, SIGNAL(clicked(bool)), this, SLOT(on_clicked(bool)));
{
connect(this, SIGNAL(clicked(bool)), this, SLOT(on_clicked(bool)));
- connect(&
_popup
, SIGNAL(selected(int, int)),
+ connect(&
popup_
, SIGNAL(selected(int, int)),
this, SLOT(on_selected(int, int)));
}
ColourPopup& ColourButton::popup()
{
this, SLOT(on_selected(int, int)));
}
ColourPopup& ColourButton::popup()
{
- return
_popup
;
+ return
popup_
;
}
const QColor& ColourButton::colour() const
{
}
const QColor& ColourButton::colour() const
{
- return
_cur_colour
;
+ return
cur_colour_
;
}
void ColourButton::set_colour(QColor colour)
{
}
void ColourButton::set_colour(QColor colour)
{
-
_cur_colour
= colour;
+
cur_colour_
= colour;
- const unsigned int rows =
_popup
.well_array().numRows();
- const unsigned int cols =
_popup
.well_array().numCols();
+ const unsigned int rows =
popup_
.well_array().numRows();
+ const unsigned int cols =
popup_
.well_array().numCols();
for (unsigned int r = 0; r < rows; r++)
for (unsigned int c = 0; c < cols; c++)
for (unsigned int r = 0; r < rows; r++)
for (unsigned int c = 0; c < cols; c++)
- if (_popup.well_array().cellBrush(r, c).color() ==
- colour)
- {
- _popup.well_array().setSelected(r, c);
- _popup.well_array().setCurrent(r, c);
+ if (popup_.well_array().cellBrush(r, c).color() == colour) {
+ popup_.well_array().setSelected(r, c);
+ popup_.well_array().setCurrent(r, c);
return;
}
}
return;
}
}
@@
-71,39
+68,39
@@
void ColourButton::set_palette(const QColor *const palette)
{
assert(palette);
{
assert(palette);
- const unsigned int rows =
_popup
.well_array().numRows();
- const unsigned int cols =
_popup
.well_array().numCols();
+ const unsigned int rows =
popup_
.well_array().numRows();
+ const unsigned int cols =
popup_
.well_array().numCols();
for (unsigned int r = 0; r < rows; r++)
for (unsigned int c = 0; c < cols; c++)
for (unsigned int r = 0; r < rows; r++)
for (unsigned int c = 0; c < cols; c++)
-
_popup
.well_array().setCellBrush(r, c,
+
popup_
.well_array().setCellBrush(r, c,
QBrush(palette[r * cols + c]));
}
void ColourButton::on_clicked(bool)
{
QBrush(palette[r * cols + c]));
}
void ColourButton::on_clicked(bool)
{
-
_popup
.set_position(mapToGlobal(rect().center()), Popup::Bottom);
-
_popup
.show();
+
popup_
.set_position(mapToGlobal(rect().center()), Popup::Bottom);
+
popup_
.show();
}
void ColourButton::on_selected(int row, int col)
{
}
void ColourButton::on_selected(int row, int col)
{
-
_cur_colour = _popup
.well_array().cellBrush(row, col).color();
- selected(
_cur_colour
);
+
cur_colour_ = popup_
.well_array().cellBrush(row, col).color();
+ selected(
cur_colour_
);
}
}
-void ColourButton::paintEvent(QPaintEvent *e)
+void ColourButton::paintEvent(QPaintEvent *e
vent
)
{
{
- QPushButton::paintEvent(e);
+ QPushButton::paintEvent(e
vent
);
QPainter p(this);
const QRect r = rect().adjusted(SwatchMargin, SwatchMargin,
-SwatchMargin, -SwatchMargin);
p.setPen(QApplication::palette().color(QPalette::Dark));
QPainter p(this);
const QRect r = rect().adjusted(SwatchMargin, SwatchMargin,
-SwatchMargin, -SwatchMargin);
p.setPen(QApplication::palette().color(QPalette::Dark));
- p.setBrush(QBrush(
_cur_colour
));
+ p.setBrush(QBrush(
cur_colour_
));
p.drawRect(r);
}
p.drawRect(r);
}
-}
//
widgets
-}
//
pv
+}
// namespace
widgets
+}
// namespace
pv