mirror of
https://github.com/KDE/konsole.git
synced 2026-05-06 05:36:40 -04:00
Adapt to removal of KSharedPixmap/KRootPixmap
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=558225
This commit is contained in:
@@ -424,8 +424,6 @@ TEWidget::TEWidget(QWidget *parent)
|
||||
|
||||
if (!argb_visual)
|
||||
{
|
||||
// Looks better at startup with KRootPixmap based pseudo-transparency
|
||||
setAttribute(Qt::WA_NoBackground);
|
||||
}
|
||||
setAttribute(Qt::WA_PaintOnScreen); //We have our own double-buffer, so...
|
||||
}
|
||||
|
||||
@@ -106,7 +106,6 @@ Time to start a requirement list.
|
||||
#include <kstandarddirs.h>
|
||||
#include <kmenubar.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <krootpixmap.h>
|
||||
#include <krun.h>
|
||||
#include <kstdaction.h>
|
||||
#include <kinputdialog.h>
|
||||
@@ -1671,16 +1670,9 @@ void Konsole::readProperties(KConfig* config, const QString &schema, bool global
|
||||
if (te) {
|
||||
if (sch->useTransparency())
|
||||
{
|
||||
if (!rootxpms[te])
|
||||
rootxpms.insert( te, new KRootPixmap(te) );
|
||||
rootxpms[te]->setFadeEffect(sch->tr_x(), QColor(sch->tr_r(), sch->tr_g(), sch->tr_b()));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rootxpms[te]) {
|
||||
delete rootxpms[te];
|
||||
rootxpms.remove(te);
|
||||
}
|
||||
pixmap_menu_activated(sch->alignment());
|
||||
}
|
||||
|
||||
@@ -1962,11 +1954,6 @@ void Konsole::slotSelectTabbar() {
|
||||
tabwidget->setTabPosition( QTabWidget::Bottom );
|
||||
}
|
||||
|
||||
/* FIXME: Still necessary ? */
|
||||
Q3PtrDictIterator<KRootPixmap> it(rootxpms);
|
||||
for (;it.current();++it)
|
||||
it.current()->repaint(true);
|
||||
|
||||
if (b_fixedSize)
|
||||
{
|
||||
adjustSize();
|
||||
@@ -2575,8 +2562,6 @@ void Konsole::activateSession(TESession *s)
|
||||
updateSchemaMenu();
|
||||
}
|
||||
|
||||
if (rootxpms[te])
|
||||
rootxpms[te]->start();
|
||||
notifySize(te->Columns(), te->Lines()); // set menu items
|
||||
s->setConnect(true);
|
||||
updateTitle();
|
||||
@@ -3034,10 +3019,6 @@ void Konsole::doneSession(TESession* s)
|
||||
KToggleAction *ra = session2action.find(s);
|
||||
m_view->removeAction( ra );
|
||||
tabwidget->removePage( s->widget() );
|
||||
if (rootxpms[s->widget()]) {
|
||||
delete rootxpms[s->widget()];
|
||||
rootxpms.remove(s->widget());
|
||||
}
|
||||
delete s->widget();
|
||||
if(m_removeSessionButton )
|
||||
m_removeSessionButton->setEnabled(tabwidget->count()>1);
|
||||
@@ -3614,9 +3595,6 @@ void Konsole::setSchema(ColorSchema* s, TEWidget* tewidget)
|
||||
|
||||
if (s->useTransparency()) {
|
||||
if (!argb_visual) {
|
||||
if (!rootxpms[tewidget])
|
||||
rootxpms.insert( tewidget, new KRootPixmap(tewidget) );
|
||||
rootxpms[tewidget]->setFadeEffect(s->tr_x(), QColor(s->tr_r(), s->tr_g(), s->tr_b()));
|
||||
} else {
|
||||
tewidget->setBlendColor(qRgba(s->tr_r(), s->tr_g(), s->tr_b(), int(s->tr_x() * 255)));
|
||||
QPalette palette;
|
||||
@@ -3624,10 +3602,6 @@ void Konsole::setSchema(ColorSchema* s, TEWidget* tewidget)
|
||||
tewidget->setPalette( palette ); // make sure any background pixmap is unset
|
||||
}
|
||||
} else {
|
||||
if (rootxpms[tewidget]) {
|
||||
delete rootxpms[tewidget];
|
||||
rootxpms.remove(tewidget);
|
||||
}
|
||||
pixmap_menu_activated(s->alignment(), tewidget);
|
||||
tewidget->setBlendColor(qRgba(0, 0, 0, 0xff));
|
||||
}
|
||||
@@ -3716,10 +3690,6 @@ void Konsole::detachSession(TESession* _se) {
|
||||
m_detachSession->setEnabled(false);
|
||||
|
||||
tabwidget->removePage( se_widget );
|
||||
if (rootxpms[se_widget]) {
|
||||
delete rootxpms[se_widget];
|
||||
rootxpms.remove(se_widget);
|
||||
}
|
||||
delete se_widget;
|
||||
if (b_dynamicTabHide && tabwidget->count()==1)
|
||||
tabwidget->setTabBarHidden(true);
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
#define PACKAGE "konsole"
|
||||
#define VERSION "2.0alpha"
|
||||
|
||||
class KRootPixmap;
|
||||
class QLabel;
|
||||
class QCheckBox;
|
||||
class KonsoleFind;
|
||||
@@ -298,7 +297,6 @@ private:
|
||||
ColorSchemaList* colors;
|
||||
QString s_encodingName;
|
||||
|
||||
Q3PtrDict<KRootPixmap> rootxpms;
|
||||
KWinModule* kWinModule;
|
||||
|
||||
KMenuBar* menubar;
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include <QSpinBox>
|
||||
#include <QPushButton>
|
||||
#include <kmenu.h>
|
||||
#include <krootpixmap.h>
|
||||
#include <kconfig.h>
|
||||
#include <kactioncollection.h>
|
||||
#include <kactionmenu.h>
|
||||
@@ -120,7 +119,6 @@ konsolePart::konsolePart(QWidget *_parentWidget, QObject *parent, const char *cl
|
||||
,te(0)
|
||||
,se(0)
|
||||
,colors(0)
|
||||
,rootxpm(0)
|
||||
,blinkingCursor(0)
|
||||
,showFrame(0)
|
||||
,m_useKonsoleSettings(0)
|
||||
@@ -580,18 +578,8 @@ void konsolePart::readProperties()
|
||||
te->setColorTable(sch->table()); //FIXME: set twice here to work around a bug
|
||||
|
||||
if (sch->useTransparency()) {
|
||||
if (!rootxpm)
|
||||
rootxpm = new KRootPixmap(te);
|
||||
rootxpm->setFadeEffect(sch->tr_x(), QColor(sch->tr_r(), sch->tr_g(), sch->tr_b()));
|
||||
rootxpm->start();
|
||||
rootxpm->repaint(true);
|
||||
}
|
||||
else {
|
||||
if (rootxpm) {
|
||||
rootxpm->stop();
|
||||
delete rootxpm;
|
||||
rootxpm=0;
|
||||
}
|
||||
pixmap_menu_activated(sch->alignment());
|
||||
}
|
||||
|
||||
@@ -768,18 +756,8 @@ void konsolePart::setSchema(ColorSchema* s)
|
||||
te->setColorTable(s->table()); //FIXME: set twice here to work around a bug
|
||||
|
||||
if (s->useTransparency()) {
|
||||
if (!rootxpm)
|
||||
rootxpm = new KRootPixmap(te);
|
||||
rootxpm->setFadeEffect(s->tr_x(), QColor(s->tr_r(), s->tr_g(), s->tr_b()));
|
||||
rootxpm->start();
|
||||
rootxpm->repaint(true);
|
||||
}
|
||||
else {
|
||||
if (rootxpm) {
|
||||
rootxpm->stop();
|
||||
delete rootxpm;
|
||||
rootxpm=0;
|
||||
}
|
||||
pixmap_menu_activated(s->alignment());
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ class QSpinBox;
|
||||
class KMenu;
|
||||
class KActionMenu;
|
||||
class QCheckBox;
|
||||
class KRootPixmap;
|
||||
class KToggleAction;
|
||||
class KSelectAction;
|
||||
|
||||
@@ -144,7 +143,6 @@ Q_SIGNALS:
|
||||
TEWidget* te;
|
||||
TESession* se;
|
||||
ColorSchemaList* colors;
|
||||
KRootPixmap* rootxpm;
|
||||
|
||||
KActionCollection* actions;
|
||||
KActionCollection* settingsActions;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <QLineEdit>
|
||||
#include <QMatrix>
|
||||
#include <QComboBox>
|
||||
#include <QDesktopWidget>
|
||||
//Added by qt3to4:
|
||||
#include <QPixmap>
|
||||
#include <QTextStream>
|
||||
@@ -42,7 +43,6 @@
|
||||
#include <kinputdialog.h>
|
||||
#include <QToolButton>
|
||||
#include <kmessagebox.h>
|
||||
#include <ksharedpixmap.h>
|
||||
#include <kimageeffect.h>
|
||||
#include <QImage>
|
||||
|
||||
@@ -76,11 +76,6 @@ SchemaEditor::SchemaEditor(QWidget * parent)
|
||||
bold.resize(20);
|
||||
transparent.resize(20);
|
||||
defaultSchema = "";
|
||||
spix = new KSharedPixmap;
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
connect(spix, SIGNAL(done(bool)), SLOT(previewLoaded(bool)));
|
||||
#endif
|
||||
|
||||
QDBusInterface kdesktop("org.kde.kdesktop", "/Background", "org.kde.kdesktop.Background");
|
||||
kdesktop.call( "setExport", 1 );
|
||||
@@ -148,7 +143,6 @@ void SchemaEditor::setSchema(QString sch)
|
||||
|
||||
SchemaEditor::~SchemaEditor()
|
||||
{
|
||||
delete spix;
|
||||
}
|
||||
|
||||
|
||||
@@ -167,10 +161,18 @@ void SchemaEditor::updatePreview()
|
||||
}
|
||||
else //try to reload
|
||||
{
|
||||
#ifdef Q_WS_X11
|
||||
if(!spix->loadFromShared(QString("DESKTOP1")))
|
||||
kDebug(0) << "cannot load" << endl;
|
||||
#endif
|
||||
QMatrix mat;
|
||||
QDesktopWidget desktopWidget;
|
||||
QPixmap pixmap = QPixmap::grabWidget( desktopWidget.screen( 0 ) );
|
||||
|
||||
pix = pixmap.transformed( mat.scale(180.0 / pixmap.width(),
|
||||
100.0 / pixmap.height()) );
|
||||
|
||||
kDebug(0) << "Loaded" << endl;
|
||||
loaded = true;
|
||||
if (transparencyCheck->isChecked()) {
|
||||
updatePreview();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
QPixmap pm;
|
||||
@@ -185,26 +187,6 @@ void SchemaEditor::updatePreview()
|
||||
|
||||
}
|
||||
|
||||
void SchemaEditor::previewLoaded(bool l)
|
||||
{
|
||||
if (l) {
|
||||
QMatrix mat;
|
||||
pix =
|
||||
spix->pixmap().transformed(mat.
|
||||
scale(180.0 / spix->pixmap().width(),
|
||||
100.0 / spix->pixmap().height()));
|
||||
kDebug(0) << "Loaded" << endl;
|
||||
loaded = true;
|
||||
if (transparencyCheck->isChecked()) {
|
||||
updatePreview();
|
||||
}
|
||||
|
||||
} else
|
||||
kDebug(0) << "error loading" << endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void SchemaEditor::getList()
|
||||
{
|
||||
if (! schemaLoaded) {
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <QWidget>
|
||||
#include <QPixmap>
|
||||
#include <QVector>
|
||||
class KSharedPixmap;
|
||||
|
||||
#include "schemadialog.h"
|
||||
|
||||
@@ -56,7 +55,6 @@ class SchemaEditor : public SchemaDialog
|
||||
void readSchema(int);
|
||||
void saveCurrent();
|
||||
void removeCurrent();
|
||||
void previewLoaded(bool l);
|
||||
void getList();
|
||||
private Q_SLOTS:
|
||||
void show();
|
||||
@@ -70,7 +68,6 @@ class SchemaEditor : public SchemaDialog
|
||||
QVector<bool> transparent;
|
||||
QVector<bool> bold;
|
||||
QPixmap pix;
|
||||
KSharedPixmap *spix;
|
||||
QString defaultSchema;
|
||||
bool loaded;
|
||||
bool schemaLoaded;
|
||||
|
||||
Reference in New Issue
Block a user