More fixes.

work/plasma6
Lana Black 8 months ago
parent 475d200ef3
commit 7ba8f7bbfe

@ -70,6 +70,7 @@ target_link_libraries(latte-dock
KF6::GlobalAccel
KF6::I18n
KF6::IconThemes
KF6::IconWidgets
KF6::KIOWidgets
KF6::Notifications
KF6::NewStuffWidgets

@ -27,7 +27,6 @@ public:
}
}
Q_DECLARE_METATYPE(Latte::Data::Generic)
Q_DECLARE_METATYPE(Latte::Data::GenericBasicTable)
#endif

@ -10,6 +10,7 @@
#include "generictable.h"
// Qt
#include <QMetaType>
#include <QString>
namespace Latte {
@ -37,6 +38,6 @@ public:
}
}
Q_DECLARE_METATYPE(Latte::Data::Generic)
#endif

@ -26,6 +26,8 @@
// KDE
#include <KIconDialog>
#include <kmessagebox.h>
#include <qabstractbutton.h>
namespace Latte {
namespace Settings {
@ -73,11 +75,15 @@ void DetailsHandler::init()
m_ui->patternClearBtn->setFixedHeight(m_ui->backgroundBtn->height()+2);
connect(m_backButtonsGroup, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled),
[ = ](int id, bool checked) {
connect(m_backButtonsGroup, &QButtonGroup::buttonToggled,
[ this ](QAbstractButton *id, bool checked) {
if (checked) {
setBackgroundStyle(static_cast<Latte::Layout::BackgroundStyle>(id));
// FIXME:
// I've no idea wtf was going on here. This code was likely incorrect to begin with.
Latte::Layout::BackgroundStyle style = id
? Latte::Layout::PatternBackgroundStyle
: Latte::Layout::ColorBackgroundStyle;
setBackgroundStyle(static_cast<Latte::Layout::BackgroundStyle>(style));
}
});
@ -264,11 +270,11 @@ void DetailsHandler::onCurrentLayoutIndexChanged(int row)
if (hasChangedData()) { //new layout was chosen but there are changes
KMessageBox::ButtonCode result = saveChangesConfirmation();
if (result == KMessageBox::Yes) {
if (result == KMessageBox::PrimaryAction) {
switchtonewlayout = true;
m_lastConfirmedLayoutIndex = row;
save();
} else if (result == KMessageBox::No) {
} else if (result == KMessageBox::SecondaryAction) {
switchtonewlayout = true;
m_lastConfirmedLayoutIndex = row;
} else if (result == KMessageBox::Cancel) {

@ -141,7 +141,7 @@ void PatternWidget::paintEvent(QPaintEvent *event)
//! it is needed from Qt, otherwise QWidget is not updated
//! https://wiki.qt.io/How_to_Change_the_Background_Color_of_QWidget
QStyleOption opt;
opt.init(this);
opt.initFrom(this);
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing, true);

@ -33,6 +33,7 @@
// Plasma
#include <Plasma/Containment>
#include <kmessagebox.h>
namespace Latte {
namespace Settings {
@ -294,11 +295,11 @@ void ExportTemplateHandler::save()
bool ExportTemplateHandler::overwriteConfirmation(const QString &fileName)
{
return (KMessageBox::warningYesNo(m_dialog,
return (KMessageBox::warningTwoActions(m_dialog,
i18n("The file \"%1\" already exists. Do you wish to overwrite it?", fileName),
i18n("Overwrite File?"),
KStandardGuiItem::overwrite(),
KStandardGuiItem::cancel()) == KMessageBox::Yes);
KStandardGuiItem::cancel()) == KMessageBox::PrimaryAction);
}
}

@ -16,6 +16,7 @@
// KDE
#include <KMessageBox>
#include <kmessagebox.h>
namespace Latte {
namespace Settings {
@ -129,12 +130,12 @@ void ScreensHandler::save()
bool ScreensHandler::removalConfirmation(const QStringList &screens) const
{
return (KMessageBox::warningYesNo(m_dialog,
return (KMessageBox::warningContinueCancel(m_dialog,
i18np("You are going to <b>remove %2</b> reference completely.<br/>Would you like to continue?",
"You are going to <b>remove %2</b> references completely.<br/>Would you like to continue?",
screens.count(),
screens.join(", ")),
i18n("Approve Removal")) == KMessageBox::Yes);
i18n("Approve Removal")) == KMessageBox::PrimaryAction);
}
}

Loading…
Cancel
Save