[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: new background option.
From: Mofeed Shahin <shahin () labf ! org>
Date: 2001-08-06 16:22:43
[Download RAW message or body]
G'day,
I have just implemented a new type of KDE background image option called
Tiled Maxpect.
I sent the email to the author g.t.jansen@stud.tue.nl but he imformed me that
he wasn't working on KDE that much anymore, and that I should send the patch
this mailing list.
So here it is.
Mof.
PS : I am not subscribed to the mailing list.
["diff" (text/x-c)]
diff -u kdebase-2.1-old/kcontrol/background/backgnd.cpp \
kdebase-2.1-new/kcontrol/background/backgnd.cpp
--- kdebase-2.1-old/kcontrol/background/backgnd.cpp Wed Feb 7 05:02:05 2001
+++ kdebase-2.1-new/kcontrol/background/backgnd.cpp Sat Aug 4 20:37:12 2001
@@ -446,6 +446,7 @@
m_pArrangementBox->insertItem(i18n("Tiled"));
m_pArrangementBox->insertItem(i18n("Center Tiled"));
m_pArrangementBox->insertItem(i18n("Centered Maxpect"));
+ m_pArrangementBox->insertItem(i18n("Tiled Maxpect"));
m_pArrangementBox->insertItem(i18n("Scaled"));
m_pArrangementBox->setFixedWidth(width);
}
diff -u kdebase-2.1-old/kcontrol/background/bgrender.cc \
kdebase-2.1-new/kcontrol/background/bgrender.cc
--- kdebase-2.1-old/kcontrol/background/bgrender.cc Fri Feb 9 18:24:09 2001
+++ kdebase-2.1-new/kcontrol/background/bgrender.cc Sat Aug 4 21:28:42 2001
@@ -331,6 +331,7 @@
d.setRect(0, 0, w, h);
break;
case CentredMaxpect:
+ {
double sx = (double) w / ww;
double sy = (double) h / wh;
if (sx > sy) {
@@ -342,6 +343,22 @@
}
wp = wp.smoothScale(ww, wh);
d.setRect((w - ww) / 2, (h - wh) / 2, ww, wh);
+ }
+ break;
+ case TiledMaxpect:
+ {
+ double sx = (double) w / ww;
+ double sy = (double) h / wh;
+ if (sx > sy) {
+ ww = (int)(sy * ww);
+ wh = h;
+ } else {
+ wh = (int)(sx * wh);
+ ww = w;
+ }
+ wp = wp.smoothScale(ww, wh);
+ d.setRect(0, 0, w, h);
+ }
break;
}
diff -u kdebase-2.1-old/kcontrol/background/bgsettings.cc \
kdebase-2.1-new/kcontrol/background/bgsettings.cc
--- kdebase-2.1-old/kcontrol/background/bgsettings.cc Wed Feb 7 05:02:05 2001
+++ kdebase-2.1-new/kcontrol/background/bgsettings.cc Sat Aug 4 20:39:52 2001
@@ -453,6 +453,7 @@
ADD_STRING(Tiled)
ADD_STRING(CenterTiled)
ADD_STRING(CentredMaxpect)
+ ADD_STRING(TiledMaxpect)
ADD_STRING(Scaled)
#undef ADD_STRING
diff -u kdebase-2.1-old/kcontrol/background/bgsettings.h \
kdebase-2.1-new/kcontrol/background/bgsettings.h
--- kdebase-2.1-old/kcontrol/background/bgsettings.h Fri Aug 4 19:13:05 2000
+++ kdebase-2.1-new/kcontrol/background/bgsettings.h Sat Aug 4 20:41:26 2001
@@ -188,7 +188,7 @@
QString wallpaper() const { return m_Wallpaper; }
enum WallpaperMode {
- NoWallpaper, Centred, Tiled, CenterTiled, CentredMaxpect,
+ NoWallpaper, Centred, Tiled, CenterTiled, CentredMaxpect, TiledMaxpect,
Scaled, lastWallpaperMode
};
void setWallpaperMode(int mode);
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic