Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Future
* Memory view now shows compressed memory when zswap is used
* Implemented Intel GPU backend
* Performance side panel is now resizable

# 1.0.5
* Perf -> Network:
Expand Down
2 changes: 2 additions & 0 deletions src/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ void Configuration::Load()
this->PerfNetworkUseBits = s.value("Performance/NetworkUseBits", this->PerfNetworkUseBits).toBool();
this->PerfGraphWindowSec = s.value("Performance/GraphWindowSec", this->PerfGraphWindowSec).toInt();
this->PerfSidePanelGroupOrder = s.value("Performance/SidePanelGroupOrder", this->PerfSidePanelGroupOrder).toStringList();
this->PerformanceSplitterState = s.value("Performance/SplitterState", this->PerformanceSplitterState).toByteArray();

// For now this is hardcoded, we may want to make it customizable later
this->RefreshRateAvailableIntervals = { 250, 500, 1000, 2000, 5000, 15000 };
Expand Down Expand Up @@ -203,6 +204,7 @@ void Configuration::Save()
s.setValue("Performance/NetworkUseBits", this->PerfNetworkUseBits);
s.setValue("Performance/GraphWindowSec", this->PerfGraphWindowSec);
s.setValue("Performance/SidePanelGroupOrder", this->PerfSidePanelGroupOrder);
s.setValue("Performance/SplitterState", this->PerformanceSplitterState);

s.sync();
}
1 change: 1 addition & 0 deletions src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class Configuration : public QObject
bool PerfNetworkUseBits { true };
int PerfGraphWindowSec { 60 };
QStringList PerfSidePanelGroupOrder;
QByteArray PerformanceSplitterState; ///< Saved via QSplitter::saveState()

private:
explicit Configuration(QObject *parent = nullptr);
Expand Down
1 change: 0 additions & 1 deletion src/perf/sidepanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ SidePanel::SidePanel(QWidget *parent) : QWidget(parent)
this->setLayout(outerLayout);

this->setMinimumWidth(150);
this->setMaximumWidth(200);
}

void SidePanel::ApplyColorScheme()
Expand Down
25 changes: 18 additions & 7 deletions src/performancewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <QMenu>
#include <QPalette>
#include <QRegularExpression>
#include <QSplitter>

namespace
{
Expand Down Expand Up @@ -134,15 +135,25 @@ void PerformanceWidget::setupLayout()
// The .ui gives us a bare QHBoxLayout (horizontalLayout) — populate it.
QHBoxLayout *lay = qobject_cast<QHBoxLayout *>(this->layout());

lay->addWidget(this->m_sidePanel);
this->m_splitter = new QSplitter(Qt::Horizontal, this);
this->m_splitter->setChildrenCollapsible(false);
this->m_splitter->addWidget(this->m_sidePanel);
this->m_splitter->addWidget(this->m_stack);
this->m_splitter->setStretchFactor(0, 0);
this->m_splitter->setStretchFactor(1, 1);

// Thin separator line
QFrame *separator = new QFrame(this);
separator->setFrameShape(QFrame::VLine);
separator->setFrameShadow(QFrame::Sunken);
lay->addWidget(separator);
const QByteArray saved_state = CFG->PerformanceSplitterState;
if (!saved_state.isEmpty())
this->m_splitter->restoreState(saved_state);
else
this->m_splitter->setSizes({ 220, 680 });

lay->addWidget(this->m_stack, /*stretch=*/1);
connect(this->m_splitter, &QSplitter::splitterMoved, this, [this](int, int)
{
CFG->PerformanceSplitterState = this->m_splitter->saveState();
});

lay->addWidget(this->m_splitter);
}

void PerformanceWidget::setupSidePanel()
Expand Down
2 changes: 2 additions & 0 deletions src/performancewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <QHash>
#include <QPoint>
#include <QSplitter>
#include <QStackedWidget>
#include <QVector>
#include <QWidget>
Expand Down Expand Up @@ -56,6 +57,7 @@ class PerformanceWidget : public QWidget
Ui::PerformanceWidget *ui;
Perf::SidePanel *m_sidePanel;
QStackedWidget *m_stack;
QSplitter *m_splitter { nullptr };
QHash<Perf::SidePanelItem *, QWidget *> m_detailByItem;
Perf::SidePanelItem *m_cpuItem { nullptr };
Perf::SidePanelItem *m_memoryItem { nullptr };
Expand Down
Loading