mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-27 14:50:21 +03:00
fix #385,load font through QFontDatabase
This commit is contained in:
parent
e36033bde7
commit
32215c6f43
@ -33,6 +33,7 @@
|
||||
#include <QDBusConnection>
|
||||
#include <QDebug>
|
||||
#include <QDesktopWidget>
|
||||
#include <QFontDatabase>
|
||||
#include <QQmlContext>
|
||||
|
||||
#include <Plasma>
|
||||
@ -69,6 +70,8 @@ DockCorona::DockCorona(QObject *parent)
|
||||
|
||||
setKPackage(package);
|
||||
qmlRegisterTypes();
|
||||
QFontDatabase::addApplicationFont(kPackage().filePath("tangerineFont"));
|
||||
|
||||
connect(this, &Corona::containmentAdded, this, &DockCorona::addDock);
|
||||
|
||||
if (m_activityConsumer && (m_activityConsumer->serviceStatus() == KActivities::Consumer::Running)) {
|
||||
|
@ -45,6 +45,7 @@ void DockPackage::initPackage(KPackage::Package *package)
|
||||
//Configuration
|
||||
package->addFileDefinition("lattedockconfigurationui", QStringLiteral("configuration/LatteDockConfiguration.qml"), i18n("Dock configuration UI"));
|
||||
package->addFileDefinition("configmodel", QStringLiteral("configuration/config.qml"), i18n("Config model"));
|
||||
package->addFileDefinition("tangerineFont", QStringLiteral("fonts/tangerine.ttf"), i18n("Tangerine Font"));
|
||||
package->setFallbackPackage(fallback);
|
||||
qDebug() << "package is valid" << package->isValid();
|
||||
}
|
||||
@ -53,9 +54,9 @@ void DockPackage::pathChanged(KPackage::Package *package)
|
||||
{
|
||||
if (!package->metadata().isValid())
|
||||
return;
|
||||
|
||||
|
||||
const QString pluginName = package->metadata().pluginId();
|
||||
|
||||
|
||||
if (!pluginName.isEmpty() && pluginName != "org.kde.latte.shell") {
|
||||
auto fallback = KPackage::PackageLoader::self()->loadPackage("Plasma/Shell", "org.kde.latte.shell");
|
||||
package->setFallbackPackage(fallback);
|
||||
|
@ -46,12 +46,6 @@ PlasmaCore.FrameSvgItem {
|
||||
|
||||
property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical
|
||||
|
||||
FontLoader {
|
||||
id: tangerineFont
|
||||
name: "Tangerine"
|
||||
source: "../fonts/tangerine.ttf"
|
||||
}
|
||||
|
||||
PlasmaComponents.ToolButton {
|
||||
id: pinButton
|
||||
|
||||
@ -130,7 +124,7 @@ PlasmaCore.FrameSvgItem {
|
||||
height: logo.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: "atte"
|
||||
font.family: tangerineFont.name
|
||||
font.family: "Tangerine"
|
||||
font.pointSize: 2 * theme.defaultFont.pointSize
|
||||
font.italic: true
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user