|
|
|
@ -24,8 +24,8 @@
|
|
|
|
|
#include <tdeaboutdata.h>
|
|
|
|
|
#include <tdeconfig.h>
|
|
|
|
|
#include <tdeglobal.h>
|
|
|
|
|
#include <kcrash.h>
|
|
|
|
|
#include <kstandarddirs.h>
|
|
|
|
|
#include <tdecrash.h>
|
|
|
|
|
#include <tdestandarddirs.h>
|
|
|
|
|
|
|
|
|
|
#undef signals
|
|
|
|
|
#include <gdk/gdkx.h>
|
|
|
|
@ -70,6 +70,7 @@ TQWidget* meepWidget = 0;
|
|
|
|
|
TQWidget* meepWidgetP = 0;
|
|
|
|
|
TQSlider* meepSlider = 0;
|
|
|
|
|
TQTabBar* meepTabBar = 0;
|
|
|
|
|
GdkGC* windowGC = 0;
|
|
|
|
|
GdkGC* altBackGC = 0;
|
|
|
|
|
TQWidget* smw = 0;
|
|
|
|
|
|
|
|
|
@ -97,6 +98,8 @@ int isKeramik;
|
|
|
|
|
int isAlloy;
|
|
|
|
|
int isDomino;
|
|
|
|
|
int isPolyester;
|
|
|
|
|
int isMotif;
|
|
|
|
|
int isCDE;
|
|
|
|
|
int eclipseFix;
|
|
|
|
|
int openOfficeFix;
|
|
|
|
|
int mozillaFix;
|
|
|
|
@ -346,7 +349,7 @@ void createTQApp()
|
|
|
|
|
int cmdlineAppNameLength = cmdlineAppName.length() + 1;
|
|
|
|
|
|
|
|
|
|
// Process hacks
|
|
|
|
|
mozillaFix = (cmdLine.contains("mozilla") || cmdLine.contains("firefox") || cmdLine.contains("iceweasel") || cmdLine.contains("thunderbird") || cmdLine.contains("icedove"));
|
|
|
|
|
mozillaFix = (cmdLine.contains("mozilla") || cmdLine.contains("firefox") || cmdLine.contains("iceweasel") || cmdLine.contains("thunderbird") || cmdLine.contains("icedove") || cmdLine.contains("palemoon"));
|
|
|
|
|
chromiumFix = (cmdLine.contains("chromium-browser") || cmdLine.contains("chrome-browser"));
|
|
|
|
|
|
|
|
|
|
openOfficeFix = (cmdLine.endsWith("soffice.bin"))
|
|
|
|
@ -444,11 +447,13 @@ void createTQApp()
|
|
|
|
|
isAlloy = (TQString(tqApp->style().name()).lower() == "alloy");
|
|
|
|
|
isDomino = (TQString(tqApp->style().name()).lower() == "domino");
|
|
|
|
|
isPolyester = (TQString(tqApp->style().name()).lower() == "polyester");
|
|
|
|
|
isMotif = (TQString(tqApp->style().name()).lower() == "motif");
|
|
|
|
|
isCDE = (TQString(tqApp->style().name()).lower() == "cde");
|
|
|
|
|
|
|
|
|
|
if (isDomino)
|
|
|
|
|
{
|
|
|
|
|
TQScrollBar sbar(NULL);
|
|
|
|
|
sbar.setOrientation(Qt::Horizontal);
|
|
|
|
|
sbar.setOrientation(TQt::Horizontal);
|
|
|
|
|
sbar.setValue(1);
|
|
|
|
|
sbar.resize(200,25);
|
|
|
|
|
|
|
|
|
@ -505,6 +510,8 @@ void destroyTQApp()
|
|
|
|
|
delete tqApp;
|
|
|
|
|
tqApp = 0;
|
|
|
|
|
}
|
|
|
|
|
if (windowGC != 0)
|
|
|
|
|
gtk_gc_release(windowGC);
|
|
|
|
|
if (altBackGC != 0)
|
|
|
|
|
gtk_gc_release(altBackGC);
|
|
|
|
|
|
|
|
|
@ -652,10 +659,40 @@ TQColor gdkColorToTQColor(GdkColor* c)
|
|
|
|
|
return TQColor(c->red / 256, c->green / 256, c->blue / 256);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawTQPixmapToWindow(GdkWindow* window, GdkGC* gc, TQPixmap* pixmap, int x, int y, int w, int h)
|
|
|
|
|
{
|
|
|
|
|
GdkPixmap* pix;
|
|
|
|
|
|
|
|
|
|
// gdk_drawable_get_image crashes if requested region is outside of the window.
|
|
|
|
|
// Bitmap masks cause artifacts with Domino and Baghira.
|
|
|
|
|
int width, height;
|
|
|
|
|
gdk_drawable_get_size(window, &width, &height);
|
|
|
|
|
if (!pixmap->hasAlpha() || isDomino || isBaghira ||
|
|
|
|
|
(width < x + w) || (height < y + h) || (0 > x) || (0 > y)) {
|
|
|
|
|
pix = gdk_pixmap_foreign_new(pixmap->handle());
|
|
|
|
|
gdk_draw_drawable(window, gc, pix, 0, 0, x, y, w, h);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Gdk isn't aware of the TQPixmap mask,
|
|
|
|
|
// so instead we create a new pixmap from the window region and bitBlt over it.
|
|
|
|
|
if (windowGC == 0)
|
|
|
|
|
windowGC = gdk_gc_new(window);
|
|
|
|
|
TQPixmap gpixmap(w, h);
|
|
|
|
|
pix = gdk_pixmap_foreign_new(gpixmap.handle());
|
|
|
|
|
GdkImage* img = gdk_drawable_get_image(window, x, y, w, h);
|
|
|
|
|
gdk_draw_image(pix, windowGC, img, 0, 0, 0, 0, w, h);
|
|
|
|
|
bitBlt(&gpixmap, 0, 0, pixmap, 0, 0, w, h, TQt::CopyROP);
|
|
|
|
|
|
|
|
|
|
gdk_draw_drawable(window, gc, pix, 0, 0, x, y, w, h);
|
|
|
|
|
g_object_unref(img);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// The drawing functions follow the same pattern:
|
|
|
|
|
// * Set the appropriate flags
|
|
|
|
|
// * Ask QT to paint the widget to a pixmap
|
|
|
|
|
// * Ask TQt to paint the widget to a pixmap
|
|
|
|
|
// * Create a GdkPixmap that points to our TQPixmap
|
|
|
|
|
// * Paint the pixmap on the window
|
|
|
|
|
|
|
|
|
@ -755,16 +792,22 @@ void drawButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int defa
|
|
|
|
|
button.setDown(sflags&TQStyle::Style_Down);
|
|
|
|
|
button.setOn(sflags&TQStyle::Style_On);
|
|
|
|
|
|
|
|
|
|
// This emulates ::drawButton() in the Qt qbutton.cpp file
|
|
|
|
|
// This emulates ::drawButton() in the TQt qbutton.cpp file
|
|
|
|
|
tqApp->style().drawControl(TQStyle::CE_PushButton, &painter, &button,
|
|
|
|
|
TQRect(0,0,w,h), button.palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawControl(TQStyle::CE_PushButtonLabel, &painter, &button,
|
|
|
|
|
tqApp->style().subRect(TQStyle::SR_PushButtonContents, &button),
|
|
|
|
|
button.colorGroup(), sflags);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
if (!isBaghira && !isMotif && !isCDE) {
|
|
|
|
|
TQBitmap bitmap(w, h, true);
|
|
|
|
|
TQPainter bpainter(&bitmap);
|
|
|
|
|
bpainter.setBrush(TQt::color1);
|
|
|
|
|
tqApp->style().drawControlMask(TQStyle::CE_PushButton, &bpainter, &button, TQRect(0,0,w,h), sflags);
|
|
|
|
|
pixmap.setMask(bitmap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
drawTQPixmapToWindow(window, style->bg_gc[state], &pixmap, x, y, w, h);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
TQPixmap pixmap(w, h);
|
|
|
|
@ -786,9 +829,15 @@ void drawButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int defa
|
|
|
|
|
tqApp->style().drawControl(TQStyle::CE_PushButton, &painter, &button,
|
|
|
|
|
TQRect(0,0,w,h), button.palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
if (!isBaghira && !isMotif && !isCDE) {
|
|
|
|
|
TQBitmap bitmap(w, h, true);
|
|
|
|
|
TQPainter bpainter(&bitmap);
|
|
|
|
|
bpainter.setBrush(TQt::color1);
|
|
|
|
|
tqApp->style().drawControlMask(TQStyle::CE_PushButton, &bpainter, &button, TQRect(0,0,w,h), sflags);
|
|
|
|
|
pixmap.setMask(bitmap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
drawTQPixmapToWindow(window, style->bg_gc[state], &pixmap, x, y, w, h);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -832,12 +881,12 @@ void drawToolbar(GdkWindow* window, GtkStyle* style, GtkStateType state, int x,
|
|
|
|
|
else
|
|
|
|
|
painter.fillRect(0, 0, w1, h1, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_PanelDockWindow, &painter,
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_PanelDockWindow, &painter,
|
|
|
|
|
TQRect(0,0,w1,h1), tqApp->palette().active(),sflags);
|
|
|
|
|
|
|
|
|
|
if (isKeramik)
|
|
|
|
|
{
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_DockWindowSeparator, &painter,
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_DockWindowSeparator, &painter,
|
|
|
|
|
TQRect(0,0,w1,h1), tqApp->palette().active(),sflags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -887,7 +936,7 @@ void drawMenubar(GdkWindow* window, GtkStyle* style, GtkStateType state, int x,
|
|
|
|
|
else
|
|
|
|
|
painter.fillRect(0, 0, w1, h1, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_PanelMenuBar, &painter,
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_PanelMenuBar, &painter,
|
|
|
|
|
TQRect(0,0,w1,h1), tqApp->palette().active(),sflags);
|
|
|
|
|
|
|
|
|
|
bitBlt(&p, 0, 0, &pixmap, 0, 0, w, h);
|
|
|
|
@ -996,7 +1045,7 @@ void drawLineEdit(GdkWindow* window, GtkStyle* style, GtkStateType state, int ha
|
|
|
|
|
sflags |= TQStyle::Style_HasFocus;
|
|
|
|
|
|
|
|
|
|
painter.fillRect(0, 0, w, h, tqApp->palette().active().base());
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_PanelLineEdit, &painter, TQRect(0, 0, w, h), tqApp->palette().active(), sflags, TQStyleOption(1,1));
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_PanelLineEdit, &painter, TQRect(0, 0, w, h), tqApp->palette().active(), sflags, TQStyleOption(1,1));
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
@ -1023,7 +1072,7 @@ void drawFrame(GdkWindow* window, GtkStyle* style, GtkStateType state, GtkShadow
|
|
|
|
|
else
|
|
|
|
|
painter.fillRect(0, 0, w, h, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_Panel, &painter, TQRect(0, 0, w, h), tqApp->palette().active(), sflags, TQStyleOption(2,2) );
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_Panel, &painter, TQRect(0, 0, w, h), tqApp->palette().active(), sflags, TQStyleOption(2,2) );
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
@ -1066,6 +1115,11 @@ void drawCheckBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int ch
|
|
|
|
|
int realH = tqApp->style().pixelMetric(TQStyle::PM_IndicatorHeight);
|
|
|
|
|
int realW = tqApp->style().pixelMetric(TQStyle::PM_IndicatorWidth);
|
|
|
|
|
|
|
|
|
|
if (isKeramik) {
|
|
|
|
|
realW-= 2;
|
|
|
|
|
realH-= 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((realW < 1) || (realH < 1))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
@ -1079,14 +1133,18 @@ void drawCheckBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int ch
|
|
|
|
|
painter.fillRect(0, 0, realW, realH, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
tqApp->style().drawControl(TQStyle::CE_CheckBox, &painter, &checkbox, TQRect(0, 0, realW, realH), tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
// Qt checkboxes are usually bigger than GTK wants.
|
|
|
|
|
// TQt checkboxes are usually bigger than GTK wants.
|
|
|
|
|
// We cheat, and draw them over the expected area.
|
|
|
|
|
int xOffset = (realW - w) / 2;
|
|
|
|
|
int yOffset = (realH - h) / 2;
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x - xOffset, y - yOffset, realW, realH);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
TQBitmap bitmap(realW, realH, true);
|
|
|
|
|
TQPainter bpainter(&bitmap);
|
|
|
|
|
bpainter.setBrush(TQt::color1);
|
|
|
|
|
tqApp->style().drawControlMask(TQStyle::CE_CheckBox, &bpainter, &checkbox, TQRect(0,0,realW,realH), sflags);
|
|
|
|
|
pixmap.setMask(bitmap);
|
|
|
|
|
|
|
|
|
|
drawTQPixmapToWindow(window, style->bg_gc[state], &pixmap, x, y, w, h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawMenuCheck(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
|
|
|
|
@ -1117,7 +1175,7 @@ void drawMenuCheck(GdkWindow* window, GtkStyle* style, GtkStateType state, int x
|
|
|
|
|
painter.fillRect(0, 0, w, h, TQBrush(TQColor(255,255,255), *backgroundTile));
|
|
|
|
|
else
|
|
|
|
|
painter.fillRect(0, 0, w, h, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_CheckMark, &painter, TQRect(0, 0, w, h), tqApp->palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_CheckMark, &painter, TQRect(0, 0, w, h), tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
@ -1135,7 +1193,7 @@ void drawRadioButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int
|
|
|
|
|
if ((realW < 1) || (realH < 1))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
TQPixmap pixmap(realH, realW);
|
|
|
|
|
TQPixmap pixmap(realW, realH);
|
|
|
|
|
TQPainter painter(&pixmap);
|
|
|
|
|
TQRadioButton radio(0);
|
|
|
|
|
|
|
|
|
@ -1149,16 +1207,20 @@ void drawRadioButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int
|
|
|
|
|
else
|
|
|
|
|
painter.fillRect(0, 0, realW, realH, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
|
|
|
|
|
tqApp->style().drawControl(TQStyle::CE_RadioButton, &painter, &radio, TQRect(0,0,realH,realW), tqApp->palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawControl(TQStyle::CE_RadioButton, &painter, &radio, TQRect(0,0,realW,realH), tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
// Qt checkboxes are usually bigger than GTK wants.
|
|
|
|
|
// TQt checkboxes are usually bigger than GTK wants.
|
|
|
|
|
// We cheat, and draw them over the expected area.
|
|
|
|
|
int xOffset = (realW - w) / 2;
|
|
|
|
|
int yOffset = (realH - h) / 2;
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x - xOffset, y - yOffset, realW, realH);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
TQBitmap bitmap(realW, realH, true);
|
|
|
|
|
TQPainter bpainter(&bitmap);
|
|
|
|
|
bpainter.setBrush(TQt::color1);
|
|
|
|
|
tqApp->style().drawControlMask(TQStyle::CE_RadioButton, &bpainter, &radio, TQRect(0,0,realW,realH), sflags);
|
|
|
|
|
pixmap.setMask(bitmap);
|
|
|
|
|
|
|
|
|
|
drawTQPixmapToWindow(window, style->bg_gc[state], &pixmap, x-xOffset, y-yOffset, realW, realH);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1172,12 +1234,35 @@ void drawScrollBarSlider(GdkWindow* window, GtkStyle* style, GtkStateType state,
|
|
|
|
|
|
|
|
|
|
int wCorrected = w;
|
|
|
|
|
int hCorrected = h;
|
|
|
|
|
int xOffset = 0;
|
|
|
|
|
int yOffset = 0;
|
|
|
|
|
if (isDomino)
|
|
|
|
|
{
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
wCorrected = w + 14;
|
|
|
|
|
else
|
|
|
|
|
hCorrected = h + 14;
|
|
|
|
|
} else if (isKeramik) {
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL) {
|
|
|
|
|
wCorrected = w + 3;
|
|
|
|
|
hCorrected = h - 1;
|
|
|
|
|
yOffset = 1;
|
|
|
|
|
} else {
|
|
|
|
|
wCorrected = w - 1;
|
|
|
|
|
hCorrected = h + 3;
|
|
|
|
|
xOffset = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (mozillaFix) {
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL) {
|
|
|
|
|
hCorrected-= 2;
|
|
|
|
|
wCorrected-= 1;
|
|
|
|
|
yOffset+= 1;
|
|
|
|
|
} else {
|
|
|
|
|
wCorrected-= 2;
|
|
|
|
|
hCorrected-= 1;
|
|
|
|
|
xOffset+= 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
TQPixmap pixmap(wCorrected, hCorrected);
|
|
|
|
|
TQPainter painter(&pixmap);
|
|
|
|
@ -1186,7 +1271,7 @@ void drawScrollBarSlider(GdkWindow* window, GtkStyle* style, GtkStateType state,
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
sflags |= TQStyle::Style_Horizontal;
|
|
|
|
|
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_ScrollBarSlider, &painter, TQRect(0,0,wCorrected,hCorrected), tqApp->palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_ScrollBarSlider, &painter, TQRect(0,0,wCorrected,hCorrected), tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
// The domino style doesn't draw the entire slider in PE_ScrollBarSlider
|
|
|
|
|
// We have to draw PE_ScrollBarAddPage and PE_ScrollBarSubPage and piece the bits together
|
|
|
|
@ -1210,21 +1295,21 @@ void drawScrollBarSlider(GdkWindow* window, GtkStyle* style, GtkStateType state,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQPainter dominoPainter(&leftPix);
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_ScrollBarSubPage, &dominoPainter, leftRect, tqApp->palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_ScrollBarSubPage, &dominoPainter, leftRect, tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
dominoPainter.end();
|
|
|
|
|
dominoPainter.begin(&rightPix);
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_ScrollBarAddPage, &dominoPainter, rightRect, tqApp->palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_ScrollBarAddPage, &dominoPainter, rightRect, tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
bitBlt(TQT_TQPAINTDEVICE(&pixmap), 1, 0, TQT_TQPAINTDEVICE(&leftPix), leftRect.width(), 0, 6, h, Qt::CopyROP, true);
|
|
|
|
|
bitBlt(TQT_TQPAINTDEVICE(&pixmap), w-7, 0, TQT_TQPAINTDEVICE(&rightPix), 0, 0, 7, h, Qt::CopyROP, true);
|
|
|
|
|
bitBlt(&pixmap, 1, 0, &leftPix, leftRect.width(), 0, 6, h, TQt::CopyROP, true);
|
|
|
|
|
bitBlt(&pixmap, w-7, 0, &rightPix, 0, 0, 7, h, TQt::CopyROP, true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bitBlt(TQT_TQPAINTDEVICE(&pixmap), 0, 1, TQT_TQPAINTDEVICE(&leftPix), 0, leftRect.height(), w, 6, Qt::CopyROP, true);
|
|
|
|
|
bitBlt(TQT_TQPAINTDEVICE(&pixmap), 0, h-7, TQT_TQPAINTDEVICE(&rightPix), 0, 0, w, 7, Qt::CopyROP, true);
|
|
|
|
|
bitBlt(&pixmap, 0, 1, &leftPix, 0, leftRect.height(), w, 6, TQt::CopyROP, true);
|
|
|
|
|
bitBlt(&pixmap, 0, h-7, &rightPix, 0, 0, w, 7, TQt::CopyROP, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1239,7 +1324,7 @@ void drawScrollBarSlider(GdkWindow* window, GtkStyle* style, GtkStateType state,
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, endsSkip, x, y, w, h-1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x+xOffset, y+yOffset, w, h);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1267,7 +1352,7 @@ void drawScrollBar(GdkWindow* window, GtkStyle* style, GtkStateType state, int o
|
|
|
|
|
// Why oh why couldn't mozilla use native widgets instead of
|
|
|
|
|
// handling everything in cross platform.
|
|
|
|
|
|
|
|
|
|
scrollBar->setOrientation(orientation ? Qt::Vertical : Qt::Horizontal);
|
|
|
|
|
scrollBar->setOrientation(orientation ? TQt::Vertical : TQt::Horizontal);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQStyle::SFlags sflags = stateToSFlags(state);
|
|
|
|
@ -1307,9 +1392,9 @@ void drawScrollBar(GdkWindow* window, GtkStyle* style, GtkStateType state, int o
|
|
|
|
|
&painter2, scrollBar, TQRect(0, 0, w, h+thumbSize),
|
|
|
|
|
tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
bitBlt(&pixmap, 0, 0, &tmpPixmap, 0, 0, w, offset, Qt::CopyROP);
|
|
|
|
|
bitBlt(&pixmap, 0, 0, &tmpPixmap, 0, 0, w, offset, TQt::CopyROP);
|
|
|
|
|
bitBlt(&pixmap, 0, offset, &tmpPixmap, 0, offset + thumbSize,
|
|
|
|
|
w, h - offset, Qt::CopyROP);
|
|
|
|
|
w, h - offset, TQt::CopyROP);
|
|
|
|
|
} else {
|
|
|
|
|
TQRect r;
|
|
|
|
|
r = tqApp->style().querySubControlMetrics(TQStyle::CC_ScrollBar,
|
|
|
|
@ -1332,9 +1417,9 @@ void drawScrollBar(GdkWindow* window, GtkStyle* style, GtkStateType state, int o
|
|
|
|
|
&painter2, scrollBar, TQRect(0, 0, w+thumbSize, h),
|
|
|
|
|
tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
bitBlt(&pixmap, 0, 0, &tmpPixmap, 0, 0, offset, h, Qt::CopyROP);
|
|
|
|
|
bitBlt(&pixmap, 0, 0, &tmpPixmap, 0, 0, offset, h, TQt::CopyROP);
|
|
|
|
|
bitBlt(&pixmap, offset, 0, &tmpPixmap, offset + thumbSize, 0,
|
|
|
|
|
w - offset, h, Qt::CopyROP);
|
|
|
|
|
w - offset, h, TQt::CopyROP);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
@ -1444,7 +1529,7 @@ void drawSplitter(GdkWindow* window, GtkStyle* style, GtkStateType state, int or
|
|
|
|
|
if (orientation != GTK_ORIENTATION_HORIZONTAL) sflags |= TQStyle::Style_Horizontal;
|
|
|
|
|
|
|
|
|
|
painter.fillRect(0, 0, w, h, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_Splitter, &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_Splitter, &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
@ -1469,7 +1554,7 @@ void drawTabFrame(GdkWindow* window, GtkStyle* style, GtkStateType state, int x,
|
|
|
|
|
painter.fillRect(0, 0, w, h, TQBrush(TQColor(255,255,255), *backgroundTile));
|
|
|
|
|
else
|
|
|
|
|
painter.fillRect(0, 0, w, h, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_PanelTabWidget, &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags, opt);
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_PanelTabWidget, &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags, opt);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
@ -1490,7 +1575,7 @@ void drawTabFrame(GdkWindow* window, GtkStyle* style, GtkStateType state, int x,
|
|
|
|
|
painter1.fillRect(0, 0, tw, th, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_TabBarBase, &painter1, TQRect(0, 0, tw, th), tqApp->palette().active(), sflags, TQStyleOption(1,1));
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_TabBarBase, &painter1, TQRect(0, 0, tw, th), tqApp->palette().active(), sflags, TQStyleOption(1,1));
|
|
|
|
|
if (pos == GTK_POS_BOTTOM)
|
|
|
|
|
{
|
|
|
|
|
TQWMatrix m;
|
|
|
|
@ -1525,7 +1610,7 @@ void drawMenu(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int
|
|
|
|
|
painter.fillRect(0, 0, w, h, TQBrush(TQColor(255,255,255), *backgroundTile));
|
|
|
|
|
else
|
|
|
|
|
painter.fillRect(0, 0, w, h, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_PanelPopup, &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_PanelPopup, &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
@ -1604,6 +1689,7 @@ void drawProgressBar(GdkWindow * window, GtkStyle * style, GtkStateType state, G
|
|
|
|
|
bar.setPercentageVisible(false);
|
|
|
|
|
|
|
|
|
|
TQPixmap pixmap = TQPixmap::grabWidget(&bar);
|
|
|
|
|
pixmap.setMask(pixmap.createHeuristicMask());
|
|
|
|
|
|
|
|
|
|
TQWMatrix matrix;
|
|
|
|
|
switch (orientation)
|
|
|
|
@ -1617,9 +1703,7 @@ void drawProgressBar(GdkWindow * window, GtkStyle * style, GtkStateType state, G
|
|
|
|
|
if (orientation != GTK_PROGRESS_LEFT_TO_RIGHT)
|
|
|
|
|
pixmap = pixmap.xForm(matrix);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
drawTQPixmapToWindow(window, style->bg_gc[state], &pixmap, x, y, w, h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawSlider(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkAdjustment *adj, int x, int y, int w, int h, GtkOrientation orientation, int inverted)
|
|
|
|
@ -1629,7 +1713,7 @@ void drawSlider(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkAdj
|
|
|
|
|
|
|
|
|
|
meepSlider->setBackgroundOrigin(TQWidget::ParentOrigin);
|
|
|
|
|
|
|
|
|
|
meepSlider->setOrientation((orientation == GTK_ORIENTATION_HORIZONTAL) ? Qt::Horizontal : Qt::Vertical);
|
|
|
|
|
meepSlider->setOrientation((orientation == GTK_ORIENTATION_HORIZONTAL) ? TQt::Horizontal : TQt::Vertical);
|
|
|
|
|
meepSlider->setEnabled(state != GTK_STATE_INSENSITIVE);
|
|
|
|
|
|
|
|
|
|
meepSlider->setGeometry(x, y, w, h);
|
|
|
|
@ -1642,9 +1726,8 @@ void drawSlider(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkAdj
|
|
|
|
|
meepSlider->setValue(100-(int)((adj->value-adj->lower)/(adj->upper-adj->lower)*100));
|
|
|
|
|
|
|
|
|
|
TQPixmap pixmap = TQPixmap::grabWidget(meepSlider);
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
pixmap.setMask(pixmap.createHeuristicMask());
|
|
|
|
|
drawTQPixmapToWindow(window, style->bg_gc[state], &pixmap, x, y, w, h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawSpinButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int direction, int x, int y, int w, int h)
|
|
|
|
@ -1661,11 +1744,10 @@ void drawSpinButton(GdkWindow * window, GtkStyle * style, GtkStateType state, in
|
|
|
|
|
TQStyle::SFlags sflags = stateToSFlags(state);
|
|
|
|
|
|
|
|
|
|
painter.fillRect(0, 0, w, h, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
tqApp->style().tqdrawPrimitive((direction ? TQStyle::PE_SpinWidgetDown : TQStyle::PE_SpinWidgetUp), &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawPrimitive((direction ? TQStyle::PE_SpinWidgetDown : TQStyle::PE_SpinWidgetUp), &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
pixmap.setMask(pixmap.createHeuristicMask());
|
|
|
|
|
drawTQPixmapToWindow(window, style->bg_gc[state], &pixmap, x, y, w, h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawListHeader(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h)
|
|
|
|
@ -1682,7 +1764,7 @@ void drawListHeader(GdkWindow* window, GtkStyle* style, GtkStateType state, int
|
|
|
|
|
TQStyle::SFlags sflags = stateToSFlags(state) | TQStyle::Style_Horizontal;
|
|
|
|
|
|
|
|
|
|
painter.fillRect(0, 0, w, h, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_HeaderSection, &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_HeaderSection, &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
@ -1704,7 +1786,7 @@ void drawListViewItem(GdkWindow* window, GtkStyle* style, GtkStateType state, in
|
|
|
|
|
/* Get the brush corresponding to highlight color */
|
|
|
|
|
TQBrush brush = tqApp->palette().brush(TQPalette::Active, TQColorGroup::Highlight);
|
|
|
|
|
painter.setBrush(brush);
|
|
|
|
|
painter.setPen(Qt::NoPen);
|
|
|
|
|
painter.setPen(TQt::NoPen);
|
|
|
|
|
painter.drawRect(0, 0, w, h);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
@ -1858,11 +1940,10 @@ void drawArrow(GdkWindow* window, GtkStyle* style, GtkStateType state, GtkArrowT
|
|
|
|
|
else
|
|
|
|
|
painter.fillRect(0, 0, w, h, tqApp->palette().active().brush(TQColorGroup::Background));
|
|
|
|
|
|
|
|
|
|
tqApp->style().tqdrawPrimitive(element, &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags);
|
|
|
|
|
tqApp->style().drawPrimitive(element, &painter, TQRect(0,0,w,h), tqApp->palette().active(), sflags);
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h);
|
|
|
|
|
g_object_unref(pix);
|
|
|
|
|
pixmap.setMask(pixmap.createHeuristicMask());
|
|
|
|
|
drawTQPixmapToWindow(window, style->bg_gc[state], &pixmap, x, y, w, h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawFocusRect(GdkWindow * window, GtkStyle * style, int x, int y, int w, int h)
|
|
|
|
@ -1878,7 +1959,7 @@ void drawFocusRect(GdkWindow * window, GtkStyle * style, int x, int y, int w, in
|
|
|
|
|
TQColor bg(tqApp->palette().active().background());
|
|
|
|
|
|
|
|
|
|
painter.fillRect(0,0,w,h,bg);
|
|
|
|
|
tqApp->style().tqdrawPrimitive(TQStyle::PE_FocusRect, &painter, TQRect(0,0,w,h), tqApp->palette().active(), TQStyle::Style_Default, TQStyleOption(bg));
|
|
|
|
|
tqApp->style().drawPrimitive(TQStyle::PE_FocusRect, &painter, TQRect(0,0,w,h), tqApp->palette().active(), TQStyle::Style_Default, TQStyleOption(bg));
|
|
|
|
|
|
|
|
|
|
GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle());
|
|
|
|
|
gdk_draw_drawable(window, style->bg_gc[GTK_STATE_NORMAL], pix, 0, 0, x, y, w, h);
|
|
|
|
@ -2063,7 +2144,7 @@ void setRcProperties(GtkRcStyle* rc_style, int forceRecreate)
|
|
|
|
|
if (!forceRecreate && cacheFile.exists())
|
|
|
|
|
{
|
|
|
|
|
cacheFile.open(IO_ReadOnly);
|
|
|
|
|
stream.setDevice(TQT_TQIODEVICE(&cacheFile));
|
|
|
|
|
stream.setDevice(&cacheFile);
|
|
|
|
|
|
|
|
|
|
if (stream.readLine() == "# " + iconTheme + ", " + tqApp->style().name() + ", " + RC_CACHE_VERSION)
|
|
|
|
|
{
|
|
|
|
@ -2078,14 +2159,14 @@ void setRcProperties(GtkRcStyle* rc_style, int forceRecreate)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cacheFile.open(IO_WriteOnly | IO_Truncate);
|
|
|
|
|
stream.setDevice(TQT_TQIODEVICE(&cacheFile));
|
|
|
|
|
stream.setDevice(&cacheFile);
|
|
|
|
|
|
|
|
|
|
stream << "# " << iconTheme << ", " << tqApp->style().name() << ", " << RC_CACHE_VERSION << "\n\n";
|
|
|
|
|
stream << "# This file was generated by the Gtk Qt Theme Engine\n";
|
|
|
|
|
stream << "# It will be recreated when you change your KDE icon theme or widget style\n\n";
|
|
|
|
|
|
|
|
|
|
TQScrollBar sbar(NULL);
|
|
|
|
|
sbar.setOrientation(Qt::Horizontal);
|
|
|
|
|
sbar.setOrientation(TQt::Horizontal);
|
|
|
|
|
sbar.setValue(1);
|
|
|
|
|
sbar.resize(200,25);
|
|
|
|
|
|
|
|
|
@ -2177,7 +2258,7 @@ void setRcProperties(GtkRcStyle* rc_style, int forceRecreate)
|
|
|
|
|
stream << parse_rc_string("GtkButton::inner-border = {0, 0, 0, 0}", "*GtkNotebook*GtkButton*");
|
|
|
|
|
stream << parse_rc_string("GtkButton::inner-border = {0, 0, 0, 0}", "*GtkNotebook*GtkToggleButton*");
|
|
|
|
|
|
|
|
|
|
// Qt calls them tab boxes, GTK calls them notebooks (!??!?) Either way they are a pain...
|
|
|
|
|
// TQt calls them tab boxes, GTK calls them notebooks (!??!?) Either way they are a pain...
|
|
|
|
|
stream << parse_rc_string("GtkNotebook::tab-overlap = " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_TabBarTabOverlap)), "*");
|
|
|
|
|
|
|
|
|
|
// This one may not work...
|
|
|
|
|