summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Graham <[email protected]>2018-11-05 16:26:09 -0700
committerNate Graham <[email protected]>2018-11-05 16:26:25 -0700
commit8a74e73228efc85eb4a92acc9c675651d17fc5f8 (patch)
treeccce701112e886b361fbfc34b8782a08a7060c70
parent1fbc52fa30f7db49cf5d7cb822df93e1ba47f916 (diff)
[fontinst KCM] Slightly modernize layout
Summary: The Font Install KCM has a very dated layout. Thisd patch addresses some (but not all) of the aesthetic and usability deficiencies by doing the following: - Eliminate the tools menu and relocate its two items elsewhere - Move the GHNS button to the bottom-right corner, like every other KCM - Put the {nav Scan for Duplicate Fonts...} action on the toolbar - Change {nav Add...} into {nav Install from File...} to match the style of other KCMs Test Plan: {F6375087} Reviewers: #plasma, #vdg, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: plasma-devel Tags: #plasma Maniphest Tasks: T9954 Differential Revision: https://phabricator.kde.org/D16536
-rw-r--r--kcms/kfontinst/kcmfontinst/KCmFontInst.cpp37
-rw-r--r--kcms/kfontinst/kcmfontinst/KCmFontInst.h4
2 files changed, 18 insertions, 23 deletions
diff --git a/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp b/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp
index 4cc9bb2..6e077ab 100644
--- a/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp
+++ b/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp
@@ -179,8 +179,7 @@ CKCmFontInst::CKCmFontInst(QWidget *parent, const QVariantList&)
itsProgress(NULL),
itsUpdateDialog(NULL),
itsTempDir(NULL),
- itsPrintProc(NULL),
- itsDownloadFontsAct(NULL)
+ itsPrintProc(NULL)
{
setButtons(Help);
@@ -217,18 +216,12 @@ CKCmFontInst::CKCmFontInst(QWidget *parent, const QVariantList&)
fontControlLayout->setMargin(0);
// Toolbar...
- QAction *duplicateFontsAct=new QAction(QIcon::fromTheme("system-search"), i18n("Scan for Duplicate Fonts..."), this);
- //*validateFontsAct=new QAction(QIcon::fromTheme("checkmark"), i18n("Validate Fonts..."), this);
-
- if(!Misc::root())
- itsDownloadFontsAct=new QAction(QIcon::fromTheme("get-hot-new-stuff"), i18n("Get New Fonts..."), this);
- itsToolsMenu=new KActionMenu(QIcon::fromTheme("system-run"), i18n("Tools"), this);
- itsToolsMenu->addAction(duplicateFontsAct);
- //itsToolsMenu->addAction(validateFontsAct);
- if(itsDownloadFontsAct)
- itsToolsMenu->addAction(itsDownloadFontsAct);
- itsToolsMenu->setDelayed(false);
- toolbar->addAction(itsToolsMenu);
+ duplicateFontsAct=new QAction(QIcon::fromTheme("system-search"), i18n("Scan for Duplicate Fonts..."), this);
+// validateFontsAct=new QAction(QIcon::fromTheme("checkmark"), i18n("Validate Fonts..."), this);
+
+ toolbar->addAction(duplicateFontsAct);
+// toolbar->addAction(validateFontsAct);
+ toolbar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
itsFilter=new CFontFilter(toolbarWidget);
// Details - Groups...
@@ -291,8 +284,11 @@ CKCmFontInst::CKCmFontInst(QWidget *parent, const QVariantList&)
itsFontListView=new CFontListView(itsPreviewSplitter, itsFontList);
itsFontListView->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
- itsAddFontControl=new CPushButton(KGuiItem(i18n("Add..."), "list-add",
- i18n("Install fonts")),
+ itsAddFontControl=new CPushButton(KGuiItem(i18n("Install from File..."), "document-import",
+ i18n("Install fonts from a local file")),
+ fontControlWidget);
+ itsGetNewFontsControl=new CPushButton(KGuiItem(i18n("Get New Fonts..."), "get-hot-new-stuff",
+ i18n("Download new fonts")),
fontControlWidget);
itsDeleteFontControl=new CPushButton(KGuiItem(i18n("Delete"), "edit-delete",
@@ -314,12 +310,13 @@ CKCmFontInst::CKCmFontInst(QWidget *parent, const QVariantList&)
mainLayout->addWidget(toolbarWidget);
mainLayout->addWidget(itsGroupSplitter);
- fontControlLayout->addWidget(itsAddFontControl);
fontControlLayout->addWidget(itsDeleteFontControl);
fontControlLayout->addWidget(itsStatusLabel);
fontControlLayout->addItem(new QSpacerItem(0, itsListingProgress->height()+4,
QSizePolicy::Fixed, QSizePolicy::Fixed));
fontControlLayout->addWidget(itsListingProgress);
+ fontControlLayout->addWidget(itsAddFontControl);
+ fontControlLayout->addWidget(itsGetNewFontsControl);
fontsLayout->addWidget(itsPreviewSplitter);
fontsLayout->addWidget(fontControlWidget);
@@ -396,11 +393,10 @@ CKCmFontInst::CKCmFontInst(QWidget *parent, const QVariantList&)
connect(itsEnableGroupControl, SIGNAL(clicked()), SLOT(enableGroup()));
connect(itsDisableGroupControl, SIGNAL(clicked()), SLOT(disableGroup()));
connect(itsAddFontControl, SIGNAL(clicked()), SLOT(addFonts()));
+ connect(itsGetNewFontsControl, SIGNAL(clicked()), SLOT(downloadFonts()));
connect(itsDeleteFontControl, SIGNAL(clicked()), SLOT(deleteFonts()));
connect(duplicateFontsAct, SIGNAL(triggered(bool)), SLOT(duplicateFonts()));
//connect(validateFontsAct, SIGNAL(triggered(bool)), SLOT(validateFonts()));
- if(itsDownloadFontsAct)
- connect(itsDownloadFontsAct, SIGNAL(triggered(bool)), SLOT(downloadFonts()));
connect(itsPreview, SIGNAL(customContextMenuRequested(QPoint)), SLOT(previewMenu(QPoint)));
connect(itsPreviewList, SIGNAL(showMenu(QPoint)), SLOT(previewMenu(QPoint)));
connect(itsPreviewSplitter, SIGNAL(splitterMoved(int,int)), SLOT(splitterMoved()));
@@ -559,8 +555,7 @@ void CKCmFontInst::groupSelected(const QModelIndex &index)
grp->setValidated();
}
- if(itsDownloadFontsAct)
- itsDownloadFontsAct->setEnabled(grp->isPersonal() || grp->isAll());
+ itsGetNewFontsControl->setEnabled(grp->isPersonal() || grp->isAll());
}
void CKCmFontInst::print(bool all)
diff --git a/kcms/kfontinst/kcmfontinst/KCmFontInst.h b/kcms/kfontinst/kcmfontinst/KCmFontInst.h
index c8924a8..5c5e01d 100644
--- a/kcms/kfontinst/kcmfontinst/KCmFontInst.h
+++ b/kcms/kfontinst/kcmfontinst/KCmFontInst.h
@@ -117,11 +117,11 @@ class CKCmFontInst : public KCModule
CFontListView *itsFontListView;
CGroupList *itsGroupList;
CGroupListView *itsGroupListView;
- KActionMenu *itsToolsMenu;
QPushButton *itsDeleteGroupControl,
*itsEnableGroupControl,
*itsDisableGroupControl,
*itsAddFontControl,
+ *itsGetNewFontsControl,
*itsDeleteFontControl;
CFontFilter *itsFilter;
QString itsLastStatusBarMsg;
@@ -135,7 +135,7 @@ class CKCmFontInst : public KCModule
CJobRunner *itsRunner;
QMenu *itsPreviewMenu,
*itsPreviewListMenu;
- QAction *itsDownloadFontsAct;
+ QAction *duplicateFontsAct;
QWidget *itsPreviewWidget;
bool itsPreviewHidden;
};