projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix #942 by making sure we always have at least one positive div
[pulseview.git]
/
pv
/
view
/
header.cpp
diff --git
a/pv/view/header.cpp
b/pv/view/header.cpp
index 8849ee3fed2beb4b7fe8e9ba1fcfd445412c41df..e2ccfedc4e4d53cdb68d8897edaa1ec7f1622b24 100644
(file)
--- a/
pv/view/header.cpp
+++ b/
pv/view/header.cpp
@@
-23,8
+23,8
@@
#include "signal.hpp"
#include "tracegroup.hpp"
#include "signal.hpp"
#include "tracegroup.hpp"
-#include <cassert>
#include <algorithm>
#include <algorithm>
+#include <cassert>
#include <boost/iterator/filter_iterator.hpp>
#include <boost/iterator/filter_iterator.hpp>
@@
-38,11
+38,9
@@
#include <pv/widgets/popup.hpp>
using boost::make_filter_iterator;
#include <pv/widgets/popup.hpp>
using boost::make_filter_iterator;
+
+using std::count_if;
using std::dynamic_pointer_cast;
using std::dynamic_pointer_cast;
-using std::max;
-using std::make_pair;
-using std::min;
-using std::pair;
using std::shared_ptr;
using std::stable_sort;
using std::vector;
using std::shared_ptr;
using std::stable_sort;
using std::vector;
@@
-105,8
+103,7
@@
void Header::paintEvent(QPaintEvent*)
// would be clipped away.
const QRect rect(0, 0, width() - BaselineOffset, height());
// would be clipped away.
const QRect rect(0, 0, width() - BaselineOffset, height());
- vector< shared_ptr<RowItem> > items(
- view_.list_by_type<RowItem>());
+ vector< shared_ptr<RowItem> > items(view_.list_by_type<RowItem>());
stable_sort(items.begin(), items.end(),
[](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
stable_sort(items.begin(), items.end(),
[](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
@@
-138,8
+135,7
@@
void Header::contextMenuEvent(QContextMenuEvent *event)
const vector< shared_ptr<TraceTreeItem> > items(
view_.list_by_type<TraceTreeItem>());
const vector< shared_ptr<TraceTreeItem> > items(
view_.list_by_type<TraceTreeItem>());
- if (std::count_if(items.begin(), items.end(), item_selected) > 1)
- {
+ if (count_if(items.begin(), items.end(), item_selected) > 1) {
menu->addSeparator();
QAction *const group = new QAction(tr("Group"), this);
menu->addSeparator();
QAction *const group = new QAction(tr("Group"), this);
@@
-178,7
+174,7
@@
void Header::on_group()
shared_ptr<TraceGroup> group(new TraceGroup());
shared_ptr<TraceTreeItem> mouse_down_item(
shared_ptr<TraceGroup> group(new TraceGroup());
shared_ptr<TraceTreeItem> mouse_down_item(
-
std::
dynamic_pointer_cast<TraceTreeItem>(mouse_down_item_));
+ dynamic_pointer_cast<TraceTreeItem>(mouse_down_item_));
shared_ptr<TraceTreeItem> focus_item(
mouse_down_item ? mouse_down_item : selected_items.front());
shared_ptr<TraceTreeItem> focus_item(
mouse_down_item ? mouse_down_item : selected_items.front());