diff --git a/kde/applications/kate/hidpi-5.patch b/kde/applications/kate/hidpi-5.patch new file mode 100644 index 00000000..221c4294 --- /dev/null +++ b/kde/applications/kate/hidpi-5.patch @@ -0,0 +1,160 @@ +commit 90f1b2bdca5a361bfb7b7aed020c3e5be41f136a +Author: Christoph Cullmann +Date: Sat Oct 5 18:58:03 2019 +0200 + + reasonable sub-toolbar sizes, like normal QPushButton sizes + +diff --git a/addons/filebrowser/katefilebrowser.cpp b/addons/filebrowser/katefilebrowser.cpp +index 1916158a0..49c9ad27a 100644 +--- a/addons/filebrowser/katefilebrowser.cpp ++++ b/addons/filebrowser/katefilebrowser.cpp +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + #include + + //END Includes +@@ -53,7 +54,6 @@ KateFileBrowser::KateFileBrowser(KTextEditor::MainWindow *mainWindow, + : QWidget (parent) + , m_mainWindow(mainWindow) + { +- + QVBoxLayout *mainLayout = new QVBoxLayout(this); + mainLayout->setContentsMargins(0, 0, 0, 0); + mainLayout->setSpacing(0); +@@ -62,6 +62,12 @@ KateFileBrowser::KateFileBrowser(KTextEditor::MainWindow *mainWindow, + m_toolbar->setMovable(false); + m_toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly); + m_toolbar->setContextMenuPolicy(Qt::NoContextMenu); ++ ++ // ensure reasonable icons sizes, like e.g. the quick-open and co. icons ++ // the normal toolbar sizes are TOO large, e.g. for scaled stuff even more! ++ const int iconSize = style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, this); ++ m_toolbar->setIconSize(QSize(iconSize, iconSize)); ++ + mainLayout->addWidget(m_toolbar); + + // includes some actions, but not hooked into the shortcut dialog atm +@@ -243,7 +249,7 @@ void KateFileBrowser::openSelectedFiles() + if (KMessageBox::questionYesNo(this,i18np("You are trying to open 1 file, are you sure?", "You are trying to open %1 files, are you sure?", list.count())) + == KMessageBox::No) return; + } +- ++ + foreach (const KFileItem& item, list) + { + m_mainWindow->openUrl(item.url()); +@@ -334,7 +340,7 @@ void KateFileBrowser::setupActions() + optionsMenu->addAction(m_autoSyncFolder); + + m_actionCollection->addAction(QStringLiteral("configure"), optionsMenu); +- ++ + // + // Remove all shortcuts due to shortcut clashes (e.g. F5: reload, Ctrl+B: bookmark) + // BUGS: #188954, #236368 +diff --git a/addons/filetree/katefiletreeplugin.cpp b/addons/filetree/katefiletreeplugin.cpp +index 0bb3f5426..64d10d955 100644 +--- a/addons/filetree/katefiletreeplugin.cpp ++++ b/addons/filetree/katefiletreeplugin.cpp +@@ -39,6 +39,7 @@ + + #include + #include ++#include + #include + + #include "katefiletreedebug.h" +@@ -143,6 +144,12 @@ KateFileTreePluginView::KateFileTreePluginView(KTextEditor::MainWindow *mainWind + m_toolbar->setMovable(false); + m_toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly); + m_toolbar->setContextMenuPolicy(Qt::NoContextMenu); ++ ++ // ensure reasonable icons sizes, like e.g. the quick-open and co. icons ++ // the normal toolbar sizes are TOO large, e.g. for scaled stuff even more! ++ const int iconSize = m_toolView->style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, m_toolView); ++ m_toolbar->setIconSize(QSize(iconSize, iconSize)); ++ + mainLayout->addWidget(m_toolbar); + + // create filetree +diff --git a/addons/katesql/dataoutputwidget.cpp b/addons/katesql/dataoutputwidget.cpp +index 7e0dc43d9..409be4df3 100644 +--- a/addons/katesql/dataoutputwidget.cpp ++++ b/addons/katesql/dataoutputwidget.cpp +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + #include + + DataOutputWidget::DataOutputWidget(QWidget *parent) +@@ -60,7 +61,11 @@ DataOutputWidget::DataOutputWidget(QWidget *parent) + KToolBar *toolbar = new KToolBar(this); + toolbar->setOrientation(Qt::Vertical); + toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly); +- toolbar->setIconSize(QSize(16, 16)); ++ ++ // ensure reasonable icons sizes, like e.g. the quick-open and co. icons ++ // the normal toolbar sizes are TOO large, e.g. for scaled stuff even more! ++ const int iconSize = style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, this); ++ toolbar->setIconSize(QSize(iconSize, iconSize)); + + /// TODO: disable actions if no results are displayed or selected + +diff --git a/addons/katesql/textoutputwidget.cpp b/addons/katesql/textoutputwidget.cpp +index f11df6187..f443cd1d0 100644 +--- a/addons/katesql/textoutputwidget.cpp ++++ b/addons/katesql/textoutputwidget.cpp +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + TextOutputWidget::TextOutputWidget(QWidget *parent) + : QWidget(parent) +@@ -49,7 +50,11 @@ TextOutputWidget::TextOutputWidget(QWidget *parent) + KToolBar *toolbar = new KToolBar(this); + toolbar->setOrientation(Qt::Vertical); + toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly); +- toolbar->setIconSize(QSize(16, 16)); ++ ++ // ensure reasonable icons sizes, like e.g. the quick-open and co. icons ++ // the normal toolbar sizes are TOO large, e.g. for scaled stuff even more! ++ const int iconSize = style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, this); ++ toolbar->setIconSize(QSize(iconSize, iconSize)); + + /// TODO: disable actions if no results are displayed + +diff --git a/kate/katemainwindow.cpp b/kate/katemainwindow.cpp +index 39459112a..bc570a8ee 100644 +--- a/kate/katemainwindow.cpp ++++ b/kate/katemainwindow.cpp +@@ -76,6 +76,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/kate/katemdi.cpp b/kate/katemdi.cpp +index 8173ebea1..bb9698afa 100644 +--- a/kate/katemdi.cpp ++++ b/kate/katemdi.cpp +@@ -226,6 +226,11 @@ ToolView::ToolView(MainWindow *mainwin, Sidebar *sidebar, QWidget *parent) + m_toolbar = new KToolBar(this); + m_toolbar->setVisible(false); + m_toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly); ++ ++ // ensure reasonable icons sizes, like e.g. the quick-open and co. icons ++ // the normal toolbar sizes are TOO large, e.g. for scaled stuff even more! ++ const int iconSize = style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, this); ++ m_toolbar->setIconSize(QSize(iconSize, iconSize)); + } + + QSize ToolView::sizeHint() const diff --git a/kde/applications/kate/kate.py b/kde/applications/kate/kate.py index a99506ae..e62eb700 100644 --- a/kde/applications/kate/kate.py +++ b/kde/applications/kate/kate.py @@ -1,82 +1,83 @@ import info from CraftOS.osutils import OsUtils class subinfo(info.infoclass): def setTargets(self): self.versionInfo.setDefaultValues() self.displayName = "Kate" self.description = "the KDE text editor" self.webpage = "https://kate-editor.org/" self.patchToApply["19.08.1"] = [ ("hidpi.patch", 1), ("hidpi-2.patch", 1), ("hidpi-3.patch", 1), ("hidpi-4.patch", 1), + ("hidpi-5.patch", 1), ("breeze.patch", 1), ] def registerOptions(self): self.options.dynamic.registerOption("fullPlasma", False) def setDependencies(self): self.runtimeDependencies["virtual/base"] = None self.buildDependencies["kde/frameworks/extra-cmake-modules"] = None self.runtimeDependencies["libs/qt5/qtbase"] = None self.runtimeDependencies["kde/frameworks/tier1/kconfig"] = None self.runtimeDependencies["kde/frameworks/tier2/kdoctools"] = None self.runtimeDependencies["kde/frameworks/tier1/kguiaddons"] = None self.runtimeDependencies["kde/frameworks/tier1/ki18n"] = None self.runtimeDependencies["kde/frameworks/tier3/kinit"] = None self.runtimeDependencies["kde/frameworks/tier2/kjobwidgets"] = None self.runtimeDependencies["kde/frameworks/tier3/kio"] = None self.runtimeDependencies["kde/frameworks/tier3/kparts"] = None self.runtimeDependencies["kde/frameworks/tier3/ktexteditor"] = None self.runtimeDependencies["kde/frameworks/tier1/kwindowsystem"] = None self.runtimeDependencies["kde/frameworks/tier3/kxmlgui"] = None self.runtimeDependencies["kde/frameworks/tier1/kdbusaddons"] = None self.runtimeDependencies["kde/frameworks/tier1/kitemmodels"] = None self.runtimeDependencies["kde/frameworks/tier3/kactivities"] = None self.runtimeDependencies["kde/frameworks/tier1/threadweaver"] = None self.runtimeDependencies["kde/frameworks/tier3/knewstuff"] = None if self.options.dynamic.fullPlasma: self.runtimeDependencies["kde/frameworks/tier3/plasma-framework"] = None if OsUtils.isUnix(): self.runtimeDependencies["kde/applications/konsole"] = None # try to use Breeze style as Windows style has severe issues for e.g. scaling self.runtimeDependencies["kde/plasma/breeze"] = None from Package.CMakePackageBase import * class Package(CMakePackageBase): def __init__(self): CMakePackageBase.__init__(self) if not self.subinfo.options.dynamic.fullPlasma: self.subinfo.options.configure.args += " -DCMAKE_DISABLE_FIND_PACKAGE_KF5Plasma=ON" def createPackage(self): self.blacklist_file.append(os.path.join(self.packageDir(), 'blacklist.txt')) self.defines["shortcuts"] = [{"name" : "Kate", "target":"bin/kate.exe", "description" : self.subinfo.description}] # kate icons self.defines["icon"] = os.path.join(self.packageDir(), "kate.ico") self.defines["icon_png"] = os.path.join(self.sourceDir(), "kate", "icons", "150-apps-kate.png") self.defines["icon_png_44"] = os.path.join(self.sourceDir(), "kate", "icons", "44-apps-kate.png") # this requires an 310x150 variant in addition! #self.defines["icon_png_310x310"] = os.path.join(self.sourceDir(), "kate", "icons", "310-apps-kate.png") self.defines["registy_hook"] = ("""WriteRegStr SHCTX "Software\\Classes\\*\\shell\\EditWithKate" "" "Edit with Kate"\n""" """WriteRegStr SHCTX "Software\\Classes\\*\\shell\\EditWithKate\\command" "" '"$INSTDIR\\bin\\kate.exe" "%V"'\n""") self.defines["mimetypes"] = ["text/plain", "text/html", "text/xml", "text/css", "text/csv", "application/json", "application/xml", "application/javascript"] self.defines["file_types"] = [".ini", ".conf", ".cpp", ".hpp", ".py"] self.ignoredPackages.append("binary/mysql") self.ignoredPackages.append("libs/dbus") return TypePackager.createPackage(self)