use system font sizes instead of hardcoded pixel values
Plasmoid uses Kirigami.Theme.defaultFont/smallFont. Kate and KRunner use QApplication::font(). All components now respect KDE font settings.
This commit is contained in:
parent
cbed4e1be8
commit
c3155f53d8
|
|
@ -10,6 +10,7 @@
|
|||
#include <QComboBox>
|
||||
#include <QDBusReply>
|
||||
#include <QFont>
|
||||
#include <QApplication>
|
||||
#include <QMenu>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
|
@ -68,12 +69,16 @@ OllieKateView::OllieKateView(OllieKatePlugin *plugin, KTextEditor::MainWindow *m
|
|||
|
||||
// Session indicator
|
||||
m_sessionLabel = new QLabel("No session", container);
|
||||
m_sessionLabel->setStyleSheet("font-size: 10px; color: gray; padding: 2px;");
|
||||
m_sessionLabel->setStyleSheet(QStringLiteral("color: gray; padding: 2px;"));
|
||||
m_sessionLabel->setFont(QApplication::font());
|
||||
layout->addWidget(m_sessionLabel);
|
||||
|
||||
// CWD label
|
||||
m_cwdLabel = new QLabel("", container);
|
||||
m_cwdLabel->setStyleSheet("font-size: 9px; color: gray; padding: 0px 2px;");
|
||||
QFont smallFont = QApplication::font();
|
||||
smallFont.setPointSizeF(smallFont.pointSizeF() * 0.85);
|
||||
m_cwdLabel->setStyleSheet(QStringLiteral("color: gray; padding: 0px 2px;"));
|
||||
m_cwdLabel->setFont(smallFont);
|
||||
m_cwdLabel->setWordWrap(true);
|
||||
layout->addWidget(m_cwdLabel);
|
||||
|
||||
|
|
@ -111,7 +116,9 @@ OllieKateView::OllieKateView(OllieKatePlugin *plugin, KTextEditor::MainWindow *m
|
|||
// Chat view
|
||||
m_chatView = new QTextEdit(container);
|
||||
m_chatView->setReadOnly(true);
|
||||
m_chatView->setFont(QFont("monospace", 10));
|
||||
QFont monoFont("monospace");
|
||||
monoFont.setPointSize(QApplication::font().pointSize());
|
||||
m_chatView->setFont(monoFont);
|
||||
m_chatView->setPlaceholderText("No active session.\nClick 'New' or use context actions.");
|
||||
layout->addWidget(m_chatView);
|
||||
|
||||
|
|
|
|||
|
|
@ -172,7 +172,9 @@ void OllieRunner::run(const RunnerNS::RunnerContext &context, const RunnerNS::Qu
|
|||
auto *textEdit = new QTextEdit(dialog);
|
||||
textEdit->setReadOnly(true);
|
||||
textEdit->setPlainText(result);
|
||||
textEdit->setFont(QFont("monospace", 11));
|
||||
QFont monoFont("monospace");
|
||||
monoFont.setPointSize(QApplication::font().pointSize());
|
||||
textEdit->setFont(monoFont);
|
||||
layout->addWidget(textEdit);
|
||||
|
||||
auto *buttonLayout = new QHBoxLayout();
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ Item {
|
|||
|
||||
PlasmaComponents.Label {
|
||||
text: dbus.activeCwd || "Ollie"
|
||||
font.pixelSize: parent.height > 0 ? parent.height * 0.5 : 12
|
||||
font.pixelSize: parent.height > 0 ? parent.height * 0.5 : Kirigami.Theme.defaultFont.pixelSize
|
||||
elide: Text.ElideMiddle
|
||||
}
|
||||
}
|
||||
|
|
@ -160,7 +160,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
elide: Text.ElideRight
|
||||
font.family: "monospace"
|
||||
font.pixelSize: 11
|
||||
font.pixelSize: Kirigami.Theme.defaultFont.pixelSize
|
||||
visible: !sessionDelegate.renaming
|
||||
}
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ Item {
|
|||
id: inlineRenameField
|
||||
Layout.fillWidth: true
|
||||
font.family: "monospace"
|
||||
font.pixelSize: 11
|
||||
font.pixelSize: Kirigami.Theme.defaultFont.pixelSize
|
||||
visible: sessionDelegate.renaming
|
||||
onAccepted: {
|
||||
var newName = text.trim()
|
||||
|
|
@ -195,7 +195,7 @@ Item {
|
|||
Label {
|
||||
text: modelData.agent
|
||||
opacity: 0.7
|
||||
font.pixelSize: 11
|
||||
font.pixelSize: Kirigami.Theme.smallFont.pixelSize
|
||||
visible: !sessionDelegate.renaming
|
||||
}
|
||||
|
||||
|
|
@ -232,7 +232,7 @@ Item {
|
|||
? "(waiting for output...)"
|
||||
: "Select or create a session")
|
||||
font.family: "monospace"
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: Kirigami.Theme.defaultFont.pixelSize
|
||||
color: dbus.chatText
|
||||
? Kirigami.Theme.textColor
|
||||
: Kirigami.Theme.disabledTextColor
|
||||
|
|
@ -283,7 +283,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 8
|
||||
Layout.bottomMargin: 4
|
||||
font.pixelSize: 10
|
||||
font.pixelSize: Kirigami.Theme.smallFont.pixelSize
|
||||
opacity: 0.6
|
||||
text: {
|
||||
var id = dbus.activeSessionId
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ PlasmoidItem {
|
|||
|
||||
PlasmaComponents.Label {
|
||||
text: dbus.activeCwd || "Ollie"
|
||||
font.pixelSize: parent.height > 0 ? parent.height * 0.5 : 12
|
||||
font.pixelSize: parent.height > 0 ? parent.height * 0.5 : Kirigami.Theme.defaultFont.pixelSize
|
||||
elide: Text.ElideMiddle
|
||||
}
|
||||
}
|
||||
|
|
@ -161,7 +161,7 @@ PlasmoidItem {
|
|||
Layout.fillWidth: true
|
||||
elide: Text.ElideRight
|
||||
font.family: "monospace"
|
||||
font.pixelSize: 11
|
||||
font.pixelSize: Kirigami.Theme.defaultFont.pixelSize
|
||||
visible: !sessionDelegate.renaming
|
||||
}
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ PlasmoidItem {
|
|||
id: inlineRenameField
|
||||
Layout.fillWidth: true
|
||||
font.family: "monospace"
|
||||
font.pixelSize: 11
|
||||
font.pixelSize: Kirigami.Theme.defaultFont.pixelSize
|
||||
visible: sessionDelegate.renaming
|
||||
onAccepted: {
|
||||
let newName = text.trim()
|
||||
|
|
@ -196,7 +196,7 @@ PlasmoidItem {
|
|||
Label {
|
||||
text: modelData.agent
|
||||
opacity: 0.7
|
||||
font.pixelSize: 11
|
||||
font.pixelSize: Kirigami.Theme.smallFont.pixelSize
|
||||
visible: !sessionDelegate.renaming
|
||||
}
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ PlasmoidItem {
|
|||
? "(waiting for output...)"
|
||||
: "Select or create a session")
|
||||
font.family: "monospace"
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: Kirigami.Theme.defaultFont.pixelSize
|
||||
color: dbus.chatText
|
||||
? Kirigami.Theme.textColor
|
||||
: Kirigami.Theme.disabledTextColor
|
||||
|
|
@ -286,7 +286,7 @@ PlasmoidItem {
|
|||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 8
|
||||
Layout.bottomMargin: 4
|
||||
font.pixelSize: 10
|
||||
font.pixelSize: Kirigami.Theme.smallFont.pixelSize
|
||||
opacity: 0.6
|
||||
text: {
|
||||
let id = dbus.activeSessionId
|
||||
|
|
|
|||
Reference in New Issue