Commit 24b960f9 authored by Marco Martin's avatar Marco Martin
Browse files

QML port of fonts kcm

Summary:
port the fonts kcm to QML, reviving an old branch.
UI based upon M112/411
make use of the new Kirigami FormLayout
depends from D8641
Fixes T7244

Test Plan: tried all the options

Reviewers: #plasma, #vdg

Subscribers: hein, ngraham, plasma-devel

Tags: #plasma

Maniphest Tasks: T7244

Differential Revision: https://phabricator.kde.org/D8916
parent 362edf1d
......@@ -23,7 +23,13 @@ add_library(kcm_fonts MODULE ${kcm_fonts_PART_SRCS})
target_link_libraries(kcm_fonts Qt5::DBus Qt5::Xml KF5::KCMUtils KF5::I18n KF5::KDELibs4Support ${FREETYPE_LIBRARIES})
if(X11_FOUND)
target_link_libraries(kcm_fonts Qt5::X11Extras)
target_link_libraries(kcm_fonts
Qt5::X11Extras
KF5::I18n
KF5::Plasma
KF5::PlasmaQuick
KF5::Declarative
KF5::QuickAddons)
if(FONTCONFIG_FOUND)
target_link_libraries(kcm_fonts ${FONTCONFIG_LIBRARIES})
endif()
......@@ -31,9 +37,9 @@ if(X11_FOUND)
target_link_libraries(kcm_fonts ${X11_LIBRARIES})
endif()
install(TARGETS kcm_fonts DESTINATION ${PLUGIN_INSTALL_DIR} )
kcoreaddons_desktop_to_json(kcm_fonts "kcm_fonts.desktop")
########### install files ###############
install( FILES fonts.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install(TARGETS kcm_fonts DESTINATION ${PLUGIN_INSTALL_DIR}/kcms)
install(FILES kcm_fonts.desktop DESTINATION ${SERVICES_INSTALL_DIR})
kpackage_install_package(package kcm_fonts kcms)
This diff is collapsed.
......@@ -2,6 +2,8 @@
Copyright 1997 Mark Donohoe
Copyright 1999 Lars Knoll
Copyright 2000 Rik Hemsley
Copyright 2015 Antonis Tsiapaliokas <antonis.tsiapaliokas@kde.org>
Copyright 2017 Marco Martin <mart@kde.org>
Ported to kcontrol2 by Geert Jansen.
......@@ -24,128 +26,168 @@
#ifndef FONTS_H
#define FONTS_H
#include <QDialog>
#include <QLabel>
#include <QList>
#include <config-X11.h>
#include <QAbstractItemModel>
#include <QStandardItemModel>
#include <KCModule>
#include <KFontRequester>
#include <KQuickAddons/ConfigModule>
#include "kxftconfig.h"
class QCheckBox;
class QComboBox;
class QDoubleSpinBox;
class QSpinBox;
class FontAASettings;
class FontUseItem : public KFontRequester
class FontAASettings : public QObject
{
Q_OBJECT
public:
FontUseItem(QWidget *parent, const QString &name, const QString &grp,
const QString &key, const QString &rc, const QFont &default_fnt,
bool fixed = false);
void readFont();
void writeFont();
void setDefault();
void applyFontDiff(const QFont &fnt, int fontDiffFlags);
const QString &rcFile()
{
return _rcfile;
}
const QString &rcGroup()
{
return _rcgroup;
}
const QString &rcKey()
{
return _rckey;
}
private:
QString _rcfile;
QString _rcgroup;
QString _rckey;
QFont _default;
};
Q_PROPERTY(QAbstractItemModel *subPixelOptionsModel READ subPixelOptionsModel CONSTANT)
Q_PROPERTY(int subPixelCurrentIndex READ subPixelCurrentIndex WRITE setSubPixelCurrentIndex NOTIFY subPixelCurrentIndexChanged);
Q_PROPERTY(QAbstractItemModel *hintingOptionsModel READ hintingOptionsModel CONSTANT)
Q_PROPERTY(int hintingCurrentIndex READ hintingCurrentIndex WRITE setHintingCurrentIndex NOTIFY hintingCurrentIndexChanged);
class FontAASettings : public QDialog
{
Q_OBJECT
Q_PROPERTY(bool exclude READ exclude WRITE setExclude NOTIFY excludeChanged)
Q_PROPERTY(int excludeTo READ excludeTo WRITE setExcludeTo NOTIFY excludeToChanged)
Q_PROPERTY(int excludeFrom READ excludeFrom WRITE setExcludeFrom NOTIFY excludeFromChanged)
Q_PROPERTY(int antiAliasing READ antiAliasing WRITE setAntiAliasing NOTIFY aliasingChanged)
Q_PROPERTY(int dpi READ dpi WRITE setDpi NOTIFY dpiChanged)
public:
enum AASetting { AAEnabled, AASystem, AADisabled };
#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
FontAASettings(QWidget *parent);
FontAASettings(QObject *parent);
bool save(KXftConfig::AntiAliasing::State aaState);
bool load();
void load();
void defaults();
int getIndex(KXftConfig::SubPixel::Type spType);
KXftConfig::SubPixel::Type getSubPixelType();
int getIndex(KXftConfig::Hint::Style hStyle);
KXftConfig::Hint::Style getHintStyle();
void setAntiAliasingState(KXftConfig::AntiAliasing::State aaState);
void enableWidgets();
int exec() Q_DECL_OVERRIDE;
#endif
QAbstractItemModel* subPixelOptionsModel() { return m_subPixelOptionsModel; }
QAbstractItemModel* hintingOptionsModel() { return m_hintingOptionsModel; }
void setExclude(bool exclude);
bool exclude() const;
void setExcludeTo(const int &excludeTo);
int excludeTo() const;
protected Q_SLOTS:
void setExcludeFrom(const int &excludeTo);
int excludeFrom() const;
void changed();
void setAntiAliasing(const int& antiAliasing);
int antiAliasing() const;
void setDpi(const int &dpi);
int dpi() const;
int subPixelCurrentIndex();
void setSubPixelCurrentIndex(int idx);
int hintingCurrentIndex();
void setHintingCurrentIndex(int idx);
bool needsSave() const;
#endif
Q_SIGNALS:
void excludeChanged();
void excludeToChanged();
void excludeFromChanged();
void antiAliasingChanged();
void aliasingChanged();
void dpiChanged();
void subPixelCurrentIndexChanged();
void hintingCurrentIndexChanged();
#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
private:
QCheckBox *excludeRange;
QDoubleSpinBox *excludeFrom;
QDoubleSpinBox *excludeTo;
QComboBox *subPixelType;
QComboBox *hintingStyle;
QLabel *subPixelLabel;
QLabel *excludeToLabel;
bool changesMade;
int m_excludeTo;
int m_excludeToOriginal;
int m_excludeFrom;
int m_excludeFromOriginal;
int m_antiAliasing;
int m_antiAliasingOriginal;
int m_dpi;
int m_dpiOriginal;
int m_subPixelCurrentIndex = 0;
int m_hintingCurrentIndex = 0;
QStandardItemModel *m_subPixelOptionsModel;
QStandardItemModel *m_hintingOptionsModel;
bool m_exclude = false;
#endif
};
/**
* The Desktop/fonts tab in kcontrol.
*/
class KFonts : public KCModule
class KFonts : public KQuickAddons::ConfigModule
{
Q_OBJECT
Q_PROPERTY(QFont generalFont READ generalFont WRITE setGeneralFont NOTIFY generalFontChanged)
Q_PROPERTY(QFont fixedWidthFont READ fixedWidthFont WRITE setFixedWidthFont NOTIFY fixedWidthFontChanged)
Q_PROPERTY(QFont smallFont READ smallFont WRITE setSmallFont NOTIFY smallFontChanged)
Q_PROPERTY(QFont toolbarFont READ toolbarFont WRITE setToolbarFont NOTIFY toolbarFontChanged)
Q_PROPERTY(QFont menuFont READ menuFont WRITE setMenuFont NOTIFY menuFontChanged)
Q_PROPERTY(QFont windowTitleFont READ windowTitleFont WRITE setWindowTitleFont NOTIFY windowTitleFontChanged)
Q_PROPERTY(QObject *fontAASettings READ fontAASettings CONSTANT)
public:
KFonts(QWidget *parent, const QVariantList &);
KFonts(QObject *parent, const QVariantList &);
~KFonts();
void load() Q_DECL_OVERRIDE;
void save() Q_DECL_OVERRIDE;
void defaults() Q_DECL_OVERRIDE;
void setGeneralFont(const QFont &font);
QFont generalFont() const;
void setFixedWidthFont(const QFont &font);
QFont fixedWidthFont() const;
void setSmallFont(const QFont &font);
QFont smallFont() const;
void setToolbarFont(const QFont &font);
QFont toolbarFont() const;
void setMenuFont(const QFont &font);
QFont menuFont() const;
void setWindowTitleFont(const QFont &font);
QFont windowTitleFont() const;
protected Q_SLOTS:
void fontSelected();
void slotApplyFontDiff();
void slotUseAntiAliasing();
void slotCfgAa();
QObject* fontAASettings() { return m_fontAASettings; }
public Q_SLOTS:
void load();
void save();
void defaults();
Q_INVOKABLE void adjustAllFonts();
Q_SIGNALS:
void fontsHaveChanged();
void generalFontChanged();
void fixedWidthFontChanged();
void smallFontChanged();
void toolbarFontChanged();
void menuFontChanged();
void windowTitleFontChanged();
private:
#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
enum AASetting { AAEnabled, AASystem, AADisabled };
AASetting useAA, useAA_original;
QComboBox *cbAA;
QPushButton *aaSettingsButton;
FontAASettings *aaSettings;
#endif
int dpi_original;
QCheckBox *checkboxForceDpi;
QSpinBox *spinboxDpi;
QList<FontUseItem *> fontUseList;
void updateNeedsSave();
QFont applyFontDiff(const QFont &fnt, const QFont &newFont, int fontDiffFlags);
QFont m_defaultFont;
QFont m_generalFont;
QFont m_fixedWidthFont;
QFont m_smallFont;
QFont m_toolbarFont;
QFont m_menuFont;
QFont m_windowTitleFont;
QFont m_defaultFontOriginal;
QFont m_generalFontOriginal;
QFont m_fixedWidthFontOriginal;
QFont m_smallFontOriginal;
QFont m_toolbarFontOriginal;
QFont m_menuFontOriginal;
QFont m_windowTitleFontOriginal;
FontAASettings *m_fontAASettings;
};
#endif
......
......@@ -107,32 +107,24 @@ Comment=Fonts
Comment[ar]=الخطوط
Comment[bs]=Fontovi
Comment[ca]=Tipus de lletra
Comment[ca@valencia]=Tipus de lletra
Comment[cs]=Písma
Comment[da]=Skrifttyper
Comment[de]=Schriftarten
Comment[el]=Γραμματοσειρές
Comment[en_GB]=Fonts
Comment[eo]=Tiparoj
Comment[es]=Tipos de letra
Comment[et]=Fondid
Comment[eu]=Letra-tipoak
Comment[fi]=Fontit
Comment[fr]=Polices de caractères
Comment[gl]=Tipos de letra
Comment[he]=גופנים
Comment[hu]=Betűtípusok
Comment[id]=Fonta
Comment[is]=Letur
Comment[it]=Caratteri
Comment[ja]=フォント
Comment[ko]=글꼴
Comment[lt]=Šriftai
Comment[mr]=फॉन्ट
Comment[nb]=Skrifttype
Comment[nds]=Schriftoorden
Comment[nl]=Lettertypen
Comment[nn]=Skrifter
Comment[pa]=ਫੋਂਟ
Comment[pl]=Czcionki
Comment[pt]=Tipos de Letra
......@@ -154,8 +146,8 @@ Comment[zh_TW]=字型
X-KDE-Keywords=fonts,font size,styles,charsets,character sets,panel,control panel,desktops,FileManager,Toolbars,Menu,Window Title,Title,DPI,anti-aliasing,desktop fonts,toolbar fonts,character,general fonts
X-KDE-Keywords[ar]=خطوط,حجم الخط,أنماط,طقم محارف,طقوم محارف,لوحة,لوحة تحكّم,أسطح المكتب,مدير ملفات,أشرطة أدوات,قائمة,عنوان نافذة,عنوان,نقطة/بوصة,DPI,إزالة التسنّن,خطوط سطح المكتب,خطوط شريط الأدوات,محرف,خطوط عامة
X-KDE-Keywords[bs]=slova,veličina slova,stil,znakovi,postaviti znakove,ploča,kontrolna ploča,pozadina,upravitelj datoteka,alatne trake,meni,naslov prozora,naslov,DPI,niskopropusni,slova pozadine,slova na alatnoj traci,obilježja,opći fontovi
X-KDE-Keywords[ca]=tipus de lletres,mida de tipus de lletra,estils,joc de caràcters,jocs de caràcters,plafó,plafó de control,escriptoris,Gestor de fitxers,Barres d'eines,Menú,Títol de la finestra,Títol,DPI,antialiàsing,tipus de lletra d'escriptori,tipus de lletra de barra d'eines,caràcter,tipus de lletra general
X-KDE-Keywords[ca@valencia]=tipus de lletres,mida de tipus de lletra,estils,joc de caràcters,jocs de caràcters,plafó,plafó de control,escriptoris,Gestor de fitxers,Barres d'eines,Menú,Títol de la finestra,Títol,DPI,antialiàsing,tipus de lletra d'escriptori,tipus de lletra de barra d'eines,caràcter,tipus de lletra general
X-KDE-Keywords[ca]=tipus de lletres,mida de tipus de lletra,estils,joc de caràcters,jocs de caràcters,plafó,plafó de control,escriptoris,Gestor de fitxers,Barres d'eines,Menú,Títol de finestra,Títol,DPI,antialiàsing,tipus de lletra d'escriptori,tipus de lletra de barra d'eines,caràcter,tipus de lletra general
X-KDE-Keywords[ca@valencia]=tipus de lletres,mida de tipus de lletra,estils,joc de caràcters,jocs de caràcters,plafó,plafó de control,escriptoris,Gestor de fitxers,Barres d'eines,Menú,Títol de finestra,Títol,DPI,antialiàsing,tipus de lletra d'escriptori,tipus de lletra de barra d'eines,caràcter,tipus de lletra general
X-KDE-Keywords[da]=skrifttyper,skriftstørrelse,stile,tegnsæt,panel,kontrolpanel,skriveborde,filhåndtering,værktøjslinjer,menu,vinduestitel,titel,DPI,anti-aliasing,værktøjslinjer,tegn
X-KDE-Keywords[de]=Schriftarten,Schriftgrößen,Stile,Zeichensätze,Kontrollleiste,Stile,Dateiverwaltung,Arbeitsflächen,Werkzeugleisten,Menüs,Fenstertitel,Titel,DPI,Antialiasing,Arbeitsflächenschriften,Werkzeugleistenschriften,Zeichen,Allgemeine Schriftarten
X-KDE-Keywords[el]=γραμματοσειρές,μέγεθος γραμματοσειράς,στιλ,σύνολα χαρακτήρων,πίνακας,πίνακας ελέγχου,επιφάνειες εργασίας,διαχειριστής αρχείων,γραμμές εργαλείων,μενού,τίτλος παραθύρου,τίτλος,DPI,εξομάλυνση,γραμματοσειρές επιφάνειας εργασίας,γραμματοσειρές γραμμής εργαλείων,χαρακτήρας,γενικές γραμματοσειρές
......@@ -166,7 +158,7 @@ X-KDE-Keywords[eu]=letra-tipoak,letra-tamaina,estiloak,karaktere-jokoak,panela,k
X-KDE-Keywords[fi]=kirjasimet,fontit,kirjasinkoko,fonttikoko,tyylit,merkistöt,paneeli,ohjauskeskus,työpöydät,Tiedostonhallinta,Työkalurivit,Työkalupalkit,Valikko,Ikkunan otsikko,Otsikko,DPI,antialiasointi,työpöytäkirjasimet,työpöytäfontit,työkalurivikirjasimet, työkalurivien kirjasimet, työkalurivifontit, työkalurivien fontit,merkki,yleiskirjasimet,yleiset kirjasimet,yleisfontit,yleiset fontit
X-KDE-Keywords[fr]=polices, taille de police, styles, tables de caractères, jeux de caractères, tableau de bord, bureaux, Gestionnaire de Fichiers, Barre d'outils, Menu, Titre de fenêtre, Titre, DPI, anti crénelage, polices du bureau, police de barre d'outils, caractère, polices générales
X-KDE-Keywords[ga]=clónna,clófhoirne,clómhéid,stíleanna,tacair charachtar,painéal,painéal rialaithe,deasca,Bainisteoir Comhad,Barraí Uirlisí,Roghchlár,Teideal Fuinneoige,Teideal,PSO,frithailiasáil,clónna deisce,clófhoirne deisce,clónna barra uirlisí,carachtar,clónna ginearálta,clófhoirne ginearálta
X-KDE-Keywords[gl]=tipo de letra,letra,tamaño de letra,tamaño da letra,codificacións de caracteres,conxuntos de caracteres,panel,control,panel de control,escritorios,xestor de ficheiros,barras de ferramentas,menú,título de xanela,título,DPI,PPP,antialiasing,suavizado,tipos de letra do escritorio,tipos de letra das barras de ferramentas,carácter,tipos de letra xerais
X-KDE-Keywords[gl]=tipo de letra, letra, tamaño da letra, carácter, caracteres, conxunto de caracteres, glifo, panel, control, panel de control, antialiasing, suavizado
X-KDE-Keywords[hu]=betűkészletek,betűméret,stílusok,karakterkészletek,karakterkészletek,panel,beállítópanel,asztalok,Fájlkezelő,Eszköztárak,Menü,Ablakcím,Cím,DPI,élsimítás,asztal betűkészletek,eszköztár betűkészletek,karakter,általános betűkészletek
X-KDE-Keywords[ia]=fonts,grandor de font,stilos,insimules de characteres,insimules de characteres,pannello,pannello de controlo,scriptorios,Gerente de File,Barra de instrumentos,menu,Titulo de Fenestra,Titulo,DPI,anti-aliasing,fonts de scriptorio, fonts de barra de titulo, character,fonts general
X-KDE-Keywords[id]=fonta,ukuran fonta,gaya,charset,set karakter,panel,panel kendali,desktop,ManajerBerkas,Bilah Alat,Menu,Judul Jendela,Judul,DPI,anti-alias,fonta desktop,fonta bilah alat,karakter,fonta umum
......@@ -178,7 +170,6 @@ X-KDE-Keywords[mr]=फॉन्ट्स, फॉन्ट साईज, कॅ
X-KDE-Keywords[nb]=skrifter,skriftstørrelse,stiler,tegnsett,panel,kontrollpanel,skrivebord,filbehandler,Verktøylinje,Meny,Vindiustittel,tittel,DPI,kantutjevning,skrivebordsskrifter,verktøylinjeskrifter,generelle skrifter
X-KDE-Keywords[nds]=Schriftoorden,Schrift,Stilen,Tekensetten,Paneel,Stüerpaneel,Schriefdisch,Dateipleger,Warktüüchbalkens,Menü,Finstertitel,Titel,DPI,Kantstreken,anti-aliasing,Schriefdisch,Teken
X-KDE-Keywords[nl]=lettertypes,lettertype,tekengrootte,stijlen,tekensets,paneel,besturingspaneel,bureaubladen,bestandsbeheerder,werkbalken,menu,venstertitel,titel,DPI,anti-aliasing,lettertypen van bureaublad,lettertypen van werkbalk,teken,algemene lettertypes
X-KDE-Keywords[nn]=skrifter,skriftstorleik,stilar,teiknsett,teiknkodingar,panel,kontrollpanel,skrivebord,filhandsamar,verktøylinje,meny,vindaugstittel,tittel,DPI,PPT,kantutjamning,skrivebordsskrifter,verktøylinjeskrifter,generelle skriftar
X-KDE-Keywords[pl]=czcionki,rozmiar czcionki,style,zestaw znaków,panel,panel sterowania,pulpity,Menadżer plików,Paski narzędzi,Menu,Tytuł okna,Tytuł,DPI,wygładzanie,czcionki pulpitu,czcionki pasków narzędzi,znak,czcionki ogólne
X-KDE-Keywords[pt]=tipos de letra,tamanho de letra,estilos,codificações,codificações de caracteres,painel,painel de controlo,ecrãs,gestor de ficheiros,barras de ferramentas,menu,título da janela,título,PPP,suavização,tipos de letra do ecrã,tipos de letra da barra de ferramentas,carácter,tipos de letra gerais
X-KDE-Keywords[pt_BR]=fontes,tamanho da fonte,estilos,codificações,codificações de caracteres,painel,painel de controle,áreas de trabalho,gerenciador de arquivos,barras de ferramentas,Menu,Título da janela,Título,PPP,anti-aliasing,fontes da área de trabalho,fontes da barra de ferramentas,caractere,fontes gerais
......@@ -190,7 +181,7 @@ X-KDE-Keywords[sr@ijekavian]=fonts,font size,styles,charsets,character sets,pane
X-KDE-Keywords[sr@ijekavianlatin]=fonts,font size,styles,charsets,character sets,panel,control panel,desktops,FileManager,Toolbars,Menu,Window Title,Title,DPI,anti-aliasing,desktop fonts,toolbar fonts,character,general fonts,font,veličina fonta,stil,kodiranje,panel,kontrolni panel,površ,menadžer fajlova,trake alatki,meni,naslov prozora,tpi,omekšavanje,font površi,font trake alatki,znakovi,opšti font
X-KDE-Keywords[sr@latin]=fonts,font size,styles,charsets,character sets,panel,control panel,desktops,FileManager,Toolbars,Menu,Window Title,Title,DPI,anti-aliasing,desktop fonts,toolbar fonts,character,general fonts,font,veličina fonta,stil,kodiranje,panel,kontrolni panel,površ,menadžer fajlova,trake alatki,meni,naslov prozora,tpi,omekšavanje,font površi,font trake alatki,znakovi,opšti font
X-KDE-Keywords[sv]=teckensnitt,teckenstorlek,stil,teckenuppsättningar,panel,kontrollpanel,skrivbord,Filhanterare,Verktygsrader,Meny,Fönsternamn,Namn,Punkter/tum,kantutjämning,skrivbordsteckensnitt,verktygsradsteckensnitt,tecken,allmänna teckensnitt
X-KDE-Keywords[tr]=yazı tipi,yazı tipi boyutu,karakterler,karakter setleri,panel,denetim paneli,masaüstleri,Dosya Yöneticisi,Araç Çubukları,Menü,Pencere Başlığı,Başlık,DPI,yumuşatma,anti-aliasing,masaüstü yazı tipleri,araç çubuğu yazı tipleri,karakter,genel yazı tipleri,biçemler
X-KDE-Keywords[tr]=yazı tipi,yazı tipi boyutu,karakterler,karakter setleri,panel,denetim paneli,masaüstleri,Dosya Yöneticisi,Araç Çubukları,Menü,Pencere Başlığı,Başlık,DPI,yumuşatma,anti-aliasing,masaüstü yazı tipleri,araç çubuğu yazı tipleri,karakter,genel yazı tipleri
X-KDE-Keywords[uk]=fonts,font size,styles,charsets,character sets,panel,control panel,desktops,FileManager,Toolbars,Menu,Window Title,Title,DPI,anti-aliasing,desktop fonts,toolbar fonts,character,general fonts,шрифт,шрифти,розмір,розмір шрифту,стиль,стилі,гарнітура,гарнітури,кодування,набір,символ,символи,набір символів,панель,панель керування,стільниця,стільниці,файл,керування,керування файлами,менеджер,панель інструментів,меню,заголовок,заголовок вікна,роздільність,згладжування,шрифти стільниці,шрифти панелі,символ,загальні шрифти
X-KDE-Keywords[x-test]=xxfontsxx,xxfont sizexx,xxstylesxx,xxcharsetsxx,xxcharacter setsxx,xxpanelxx,xxcontrol panelxx,xxdesktopsxx,xxFileManagerxx,xxToolbarsxx,xxMenuxx,xxWindow Titlexx,xxTitlexx,xxDPIxx,xxanti-aliasingxx,xxdesktop fontsxx,xxtoolbar fontsxx,xxcharacterxx,xxgeneral fontsxx
X-KDE-Keywords[zh_CN]=fonts,font size,styles,charsets,character sets,panel,control panel,desktops,FileManager,Toolbars,Menu,Window Title,Title,DPI,anti-aliasing,desktop fonts,toolbar fonts,character,general fonts,字体字体大小,样式,字符集,面板,控制面板,桌面,文件管理器,工具栏,菜单,窗口标题,标题,反锯齿,桌面字体,工具栏字体,字符,常规字体
......
......@@ -451,7 +451,7 @@ QString KXftConfig::description(SubPixel::Type t)
switch (t) {
default:
case SubPixel::NotSet:
return i18nc("use system subpixel setting", "System default");
return i18nc("use system subpixel setting", "Vendor Default");
case SubPixel::None:
return i18nc("no subpixel rendering", "None");
case SubPixel::Rgb:
......@@ -469,6 +469,8 @@ const char *KXftConfig::toStr(SubPixel::Type t)
{
switch (t) {
default:
case SubPixel::NotSet:
return "";
case SubPixel::None:
return "none";
case SubPixel::Rgb:
......@@ -487,7 +489,7 @@ QString KXftConfig::description(Hint::Style s)
switch (s) {
default:
case Hint::NotSet:
return i18nc("use system hinting settings", "System default");
return i18nc("use system hinting settings", "Vendor Default");
case Hint::Medium:
return i18nc("medium hinting", "Medium");
case Hint::None:
......
......@@ -64,7 +64,7 @@ public:
SubPixel(Type t, QDomNode &n) : Item(n), type(t) {}
SubPixel(Type t = NotSet) : type(t) {}
void reset() Q_DECL_OVERRIDE
void reset()
{
Item::reset();
type = NotSet;
......@@ -77,7 +77,7 @@ public:
Exclude(double f, double t, QDomNode &n) : Item(n), from(f), to(t) {}
Exclude(double f = 0, double t = 0) : from(f), to(t) {}
void reset() Q_DECL_OVERRIDE
void reset()
{
Item::reset();
from = to = 0;
......@@ -99,7 +99,7 @@ public:
Hint(Style s, QDomNode &n) : Item(n), style(s) {}
Hint(Style s = NotSet) : style(s) {}
void reset() Q_DECL_OVERRIDE
void reset()
{
Item::reset();
style = NotSet;
......@@ -112,7 +112,7 @@ public:
Hinting(bool s, QDomNode &n) : Item(n), set(s) {}
Hinting(bool s = true) : set(s) {}
void reset() Q_DECL_OVERRIDE
void reset()
{
Item::reset();
set = true;
......@@ -131,7 +131,7 @@ public:
AntiAliasing(State s, QDomNode &n) : Item(n), state(s) {}
AntiAliasing(State s = NotSet) : state(s) {}
void reset() Q_DECL_OVERRIDE
void reset()
{
Item::reset();
state = NotSet;
......
/*
Copyright (c) 2015 Antonis Tsiapaliokas <antonis.tsiapaliokas@kde.org>
Copyright (c) 2017 Marco Martin <mart@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
import QtQuick 2.1
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0 as QtControls
import QtQuick.Dialogs 1.2 as QtDialogs
import org.kde.kirigami 2.3 as Kirigami
import org.kde.kcm 1.0
FocusScope {
id: root
property string label
property string category
property font font
Kirigami.FormData.label: root.label
activeFocusOnTab: true
Layout.minimumWidth: layout.Layout.minimumWidth
Layout.preferredWidth: layout.Layout.preferredWidth
Layout.minimumHeight: layout.Layout.minimumHeight
Layout.preferredHeight: layout.Layout.preferredHeight
implicitWidth: layout.implicitWidth
implicitHeight: layout.implicitHeight
RowLayout {
id: layout
QtControls.TextField {
enabled: false
text: root.font.family + " " + root.font.pointSize
font: root.font
Layout.fillHeight: true
}
QtControls.Button {
text: i18n("Choose...")
Layout.fillHeight: true
Kirigami.MnemonicData.enabled: false
focus: true
onClicked: {
fontDialog.adjustAllFonts = false;
fontDialog.currentCategory = root.category
fontDialog.font = root.font;
fontDialog.currentFont = root.font;
fontDialog.open()
}
}
}
}
/*
Copyright (c) 2015 Antonis Tsiapaliokas <antonis.tsiapaliokas@kde.org>
Copyright (c) 2017 Marco Martin <mart@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
import QtQuick 2.1
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0 as QtControls
import QtQuick.Dialogs 1.2 as QtDialogs
import org.kde.kirigami 2.3 as Kirigami
import org.kde.kcm 1.1 as KCM
KCM.SimpleKCM {
id: root
KCM.ConfigModule.quickHelp: i18n("Fonts")
Kirigami.FormLayout {
id: formLayout
readonly property int maxImplicitWidth: Math.max(adjustAllFontsButton.implicitWidth, Math.max(antiAliasingComboBox.implicitWidth, Math.max(excludeField.implicitWidth, Math.max(subPixelCombo.implicitWidth, hintingCombo.implicitWidth))))
QtControls.Button {
id: adjustAllFontsButton
Layout.preferredWidth: formLayout.maxImplicitWidth
text: i18n("&Adjust All Fonts...")
onClicked: kcm.adjustAllFonts();
}
FontWidget {
id: generalFontWidget
label: i18n("General:")
category: "generalFont"
font: kcm.generalFont
}
FontWidget {
label: i18n("Fixed width:")
category: "fixedWidthFont"
font: kcm.fixedWidthFont
}
FontWidget {
label: i18n("Small:")
category: "smallFont"
font: kcm.smallFont
}
FontWidget {
label: i18n("Toolbar:")
category: "toolbarFont"
font: kcm.toolbarFont
}
FontWidget {
label: i18n("Menu:")
category: "menuFont"
font: kcm.menuFont
}
FontWidget {
label: i18n("Window title:")
category: "windowTitleFont"
font: kcm.windowTitleFont
}
Kirigami.Separator {
Kirigami.FormData.isSection: true
}
QtControls.ComboBox {
id: antiAliasingComboBox
Layout.preferredWidth: formLayout.maxImplicitWidth
Kirigami.FormData.label: i18n("Use anti-aliasing:")
model: [i18n("Enabled"), i18n("Vendor Default"), i18n("Disabled")]
currentIndex: kcm.fontAASettings.antiAliasing
onCurrentIndexChanged: kcm.fontAASettings.antiAliasing = antiAliasingComboBox.currentIndex
}
QtControls.CheckBox {
id: excludeCheckBox
checked: kcm.fontAASettings.exclude
onCheckedChanged: kcm.fontAASettings.exclude = checked;
text: i18n("Exclude range from anti-aliasing")
Layout.fillWidth: true
enabled: antiAliasingComboBox.currentIndex == 0
}
RowLayout {
id: excludeField
Layout.preferredWidth: formLayout.maxImplicitWidth
enabled: antiAliasingComboBox.currentIndex == 0
QtControls.SpinBox {
id: excludeFromSpinBox
stepSize: 1
onValueChanged: kcm.fontAASettings.excludeFrom = value
textFromValue: function(value, locale) { return i18n("%1 pt", value)}
enabled: excludeCheckBox.checked
}
QtControls.Label {
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter