Skip to content

Commit

Permalink
new icons and new style
Browse files Browse the repository at this point in the history
  • Loading branch information
facontidavide committed Jan 19, 2019
1 parent 1f55bbd commit f83fe29
Show file tree
Hide file tree
Showing 21 changed files with 871 additions and 274 deletions.
7 changes: 6 additions & 1 deletion plotter_gui/filterablelistwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ void FilterableListWidget::clear()
ui->labelNumberDisplayed->setText( "0 of 0");
}


void FilterableListWidget::addItem(const QString &item_name)
{
if( _model->findItems(item_name).size() > 0)
Expand Down Expand Up @@ -529,3 +528,9 @@ void FilterableListWidget::on_buttonEditCustom_clicked()
auto item = _model->item( selected_index.row(), 0 );
editMathPlot( item->text().toStdString() );
}

void FilterableListWidget::clearSelections()
{
ui->tableViewCustom->clearSelection();
ui->tableView->clearSelection();
}
4 changes: 4 additions & 0 deletions plotter_gui/filterablelistwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ private slots:

void onCustomSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);

public slots:

void clearSelections();

private:

Ui::FilterableListWidget *ui;
Expand Down
12 changes: 7 additions & 5 deletions plotter_gui/filterablelistwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ border: 0.5px solid rgb(150, 150, 150);</string>
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>:/icons/resources/cog.png</normaloff>:/icons/resources/cog.png</iconset>
<iconset resource="resource.qrc">
<normaloff>:/icons/resources/settings-cog.svg</normaloff>:/icons/resources/settings-cog.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
<width>26</width>
<height>26</height>
</size>
</property>
<property name="checkable">
Expand Down Expand Up @@ -517,6 +517,8 @@ border: 1px solid rgb(150, 150, 150);</string>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<resources>
<include location="resource.qrc"/>
</resources>
<connections/>
</ui>
37 changes: 7 additions & 30 deletions plotter_gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,13 @@ int main(int argc, char *argv[])
app.setOrganizationName("IcarusTechnology");
app.setApplicationName("PlotJuggler");

qApp->setStyleSheet(QString("QToolTip {\n"
" border: 1px solid black;\n"
" border-radius: 4px;\n"
" background: white;\n"
" color: black; }\n"
" QMenu {"
"background-color: white;}"

"QMenu::item {"
" padding: 2px 25px 2px 25px;"
" color:rgb(33, 33, 33);"
" border: 1px solid transparent; margin: 2px;"
" }"

" QMenu::item:disabled {"
" background: white;"
" color:grey; }"

" QMenu::item:selected {"
" background: rgb(122, 122, 122);"
" color:white; }"

"QMenu::item:checked { color: rgb(66, 66, 100); font: bold; }"
"QMenu::item:unchecked { color: rgb(66, 66, 66); }"

" QMenu::indicator {"
" width: 24px;"
" height: 20px; }"
)
);
// Load an application style
QFile styleFile( "://resources/stylesheet.qss" );
styleFile.open( QFile::ReadOnly );

// Apply the loaded stylesheet
QString style( styleFile.readAll() );
app.setStyleSheet( style );

QString VERSION_STRING = QString("%1.%2.%3").
arg(PJ_MAJOR_VERSION).
Expand Down
3 changes: 3 additions & 0 deletions plotter_gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,9 @@ void MainWindow::onPlotAdded(PlotWidget* plot)
connect( &_time_offset, SIGNAL( valueChanged(double)),
plot, SLOT(on_changeTimeOffset(double)) );

connect( plot, &PlotWidget::curvesDropped,
_curvelist_widget, &FilterableListWidget::clearSelections);

plot->on_changeTimeOffset( _time_offset.get() );
plot->activateGrid( ui->pushButtonActivateGrid->isChecked() );
plot->enableTracker( !isStreamingActive() );
Expand Down
79 changes: 41 additions & 38 deletions plotter_gui/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ border-radius: 4px;
<height>40</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Show/Hide extra options&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
Expand All @@ -171,12 +174,12 @@ border-radius: 4px;
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/icons/resources/cog.png</normaloff>:/icons/resources/cog.png</iconset>
<normaloff>:/icons/resources/settings-cog.svg</normaloff>:/icons/resources/settings-cog.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="checkable">
Expand All @@ -187,6 +190,41 @@ border-radius: 4px;
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonTimeTracker">
<property name="minimumSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Change the amount of information displayed with the vertical TimeTracker&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/icons/resources/line_tracker_1.png</normaloff>:/icons/resources/line_tracker_1.png</iconset>
</property>
<property name="iconSize">
<size>
<width>36</width>
<height>36</height>
</size>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="displayTime">
<property name="sizePolicy">
Expand Down Expand Up @@ -392,41 +430,6 @@ background: white;
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonTimeTracker">
<property name="minimumSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Change the amount of information displayed with the vertical TimeTracker&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/icons/resources/line_tracker_1.png</normaloff>:/icons/resources/line_tracker_1.png</iconset>
</property>
<property name="iconSize">
<size>
<width>36</width>
<height>36</height>
</size>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonRemoveTimeOffset">
<property name="minimumSize">
Expand Down
2 changes: 1 addition & 1 deletion plotter_gui/plotmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PlotMatrix: public QFrame
Q_OBJECT

public:
PlotMatrix(QString name, PlotDataMapRef &datamap, QWidget * parent = NULL );
PlotMatrix(QString name, PlotDataMapRef &datamap, QWidget * parent = nullptr );
virtual ~PlotMatrix();

void addRow();
Expand Down
2 changes: 2 additions & 0 deletions plotter_gui/plotwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,13 @@ void PlotWidget::dropEvent(QDropEvent *)
bool added = addCurve( curve_name.toStdString() );
curves_changed = curves_changed || added;
}
emit curvesDropped();
}
else if( _dragging.mode == DragInfo::NEW_X)
{
changeAxisX( _dragging.curves.front() );
curves_changed = true;
emit curvesDropped();
}
else if( _dragging.mode == DragInfo::SWAP_PLOTS )
{
Expand Down
1 change: 1 addition & 0 deletions plotter_gui/plotwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class PlotWidget : public QwtPlot
void undoableChange();
void trackerMoved(QPointF pos);
void curveListChanged();
void curvesDropped();

public slots:

Expand Down
8 changes: 7 additions & 1 deletion plotter_gui/resource.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<file>resources/check.png</file>
<file>resources/checkboxalt.png</file>
<file>resources/circle_arrow_right.png</file>
<file>resources/cog.png</file>
<file>resources/line_chart_32px.png</file>
<file>resources/line_chart_48px.png</file>
<file>resources/line_chart_64px.png</file>
Expand Down Expand Up @@ -43,11 +42,18 @@
<file>resources/line_tracker_1.png</file>
<file>resources/line_tracker_a.png</file>
<file>resources/line_tracker.png</file>
<file>resources/add_column.svg</file>
<file>resources/add_row.svg</file>
<file>resources/add_tab.svg</file>
<file>resources/zoom_horizontal.svg</file>
<file>resources/zoom_vertical.svg</file>
<file>resources/settings-cog.svg</file>
</qresource>
<qresource prefix="/splash">
<file>resources/splash.jpg</file>
</qresource>
<qresource prefix="/">
<file>resources/default.snippets.xml</file>
<file>resources/stylesheet.qss</file>
</qresource>
</RCC>
93 changes: 93 additions & 0 deletions plotter_gui/resources/add_column.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f83fe29

Please sign in to comment.