Commit a68554d3 authored by Benjamin Port's avatar Benjamin Port

[Cursors] Remove Resolution Dependant option

Summary:
This option don't work as expected for years on X, and current wayland protocol don't allow to have a proper size for all application (each framework came with this own solution for this option, that mean we will not have same cursor size on different application)

We set default size as 24

BUG: 385920
BUG: 413783

Reviewers: #plasma, meven, davidedmundson, ngraham

Reviewed By: ngraham

Subscribers: ngraham, plasma-devel, kde-doc-english

Tags: #plasma, #documentation

Maniphest Tasks: T12040

Differential Revision: https://phabricator.kde.org/D28652
parent 197d3076
......@@ -53,7 +53,7 @@ displayed hoovering a theme.
</para>
<para>
The size can be set to the <guilabel>Resolution dependent</guilabel> or one of the sizes available for your theme.
The size can be set to one of the sizes available for your theme.
</para>
</article>
......@@ -54,6 +54,7 @@ kcoreaddons_desktop_to_json(kcm_cursortheme "kcm_cursortheme.desktop")
########### install files ###############
install(FILES cursorthemesettings.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
install(FILES delete_cursor_old_default_size.upd delete_cursor_old_default_size.pl DESTINATION ${KDE_INSTALL_DATADIR}/kconf_update)
install( FILES kcm_cursortheme.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install( FILES xcursor/xcursor.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR} )
......
......@@ -11,7 +11,7 @@
</entry>
<entry name="cursorSize" type="Int">
<label>Current cursor size</label>
<default>0</default>
<default>24</default>
</entry>
</group>
</kcfg>
#! /usr/bin/perl
use strict;
while (<>)
{
chomp;
s/cursorSize=0/# DELETE cursorSize/;
print "$_\n";
}
Version=5
# Delete cursor size if it's old default
Id=DeleteCursorOldDefaultSize
Options=overwrite
File=kcminputrc
Group=Mouse
Script=delete_cursor_old_default_size.pl,perl
......@@ -217,11 +217,7 @@ void CursorThemeConfig::updateSizeComboBox()
if (m_pixmap.height() > maxIconHeight) {
maxIconHeight = m_pixmap.height();
}
QStandardItem *item = new QStandardItem(QIcon(m_pixmap),
i18nc("@item:inlistbox size", "Resolution dependent"));
item->setData(0);
m_sizesModel->appendRow(item);
comboBoxList << 0;
foreach (i, sizes) {
m_pixmap = theme->createIcon(i);
if (m_pixmap.width() > maxIconWidth) {
......@@ -332,9 +328,6 @@ bool CursorThemeConfig::applyTheme(const CursorTheme *theme, const int size)
int CursorThemeConfig::cursorSizeIndex(int cursorSize) const
{
if (m_sizesModel->rowCount() > 0) {
if (cursorSize == 0) {
return 0;
}
const auto items = m_sizesModel->findItems(QString::number(cursorSize));
if (items.count() == 1) {
return items.first()->row();
......
......@@ -488,7 +488,7 @@ void runRdb( uint flags )
// Export the Xcursor theme & size settings
KConfigGroup mousecfg(KSharedConfig::openConfig( QStringLiteral("kcminputrc") ), "Mouse" );
QString theme = mousecfg.readEntry("cursorTheme", QString("breeze_cursors"));
QString size = mousecfg.readEntry("cursorSize", QString("0"));
QString size = mousecfg.readEntry("cursorSize", QString("24"));
QString contents;
if (!theme.isNull())
......
......@@ -478,7 +478,7 @@ void KCMLookandFeel::setCursorTheme(const QString themeName)
// in previous versions the Xfixes code wasn't enabled due to a bug in the
// build system (freedesktop bug #975).
#if defined(HAVE_XFIXES) && XFIXES_MAJOR >= 2 && XCURSOR_LIB_VERSION >= 10105
const int cursorSize = cg.readEntry("cursorSize", 0);
const int cursorSize = cg.readEntry("cursorSize", 24);
QDir themeDir = cursorThemeDir(themeName, 0);
......
......@@ -127,30 +127,20 @@ void X11Backend::kcmInit()
auto config = KSharedConfig::openConfig("kcminputrc", KConfig::NoGlobals);
KConfigGroup group = config->group("Mouse");
QString theme = group.readEntry("cursorTheme", QString());
QString size = group.readEntry("cursorSize", QString());
int intSize = -1;
if (size.isEmpty()) {
bool ok;
uint value = size.toUInt(&ok);
if (ok) {
intSize = value;
}
}
const int size = group.readEntry("cursorSize", 24);
// Note: If you update this code, update kapplymousetheme as well.
// use a default value for theme only if it's not configured at all, not even in X resources
if (theme.isEmpty() && currentCursorTheme().isEmpty()) {
theme = "breeze_cursors";
}
applyCursorTheme(theme, intSize);
applyCursorTheme(theme, size);
// Tell klauncher to set the XCURSOR_THEME and XCURSOR_SIZE environment
// variables when launching applications.
if (!theme.isEmpty()) {
UpdateLaunchEnvJob launchEnvJob(QStringLiteral("XCURSOR_THEME"), theme);
}
if (!size.isEmpty()) {
UpdateLaunchEnvJob launchEnvJob(QStringLiteral("XCURSOR_SIZE"), size);
}
UpdateLaunchEnvJob launchEnvJob(QStringLiteral("XCURSOR_SIZE"), QByteArray::number(size));
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment