CtrlLib: Oxygen KDE theme fixed #779

git-svn-id: svn://ultimatepp.org/upp/trunk@8194 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-02-23 09:54:33 +00:00
parent 1c495195cd
commit fed3d83480
7 changed files with 53 additions and 25 deletions

View file

@ -245,27 +245,6 @@ NAMESPACE_UPP
#include <Core/Defs.h>
END_UPP_NAMESPACE
#ifdef UPP_HEAP
#include <new>
inline void *operator new(size_t size) throw(std::bad_alloc) { void *ptr = UPP::MemoryAlloc(size); return ptr; }
inline void operator delete(void *ptr) throw() { UPP::MemoryFree(ptr); }
inline void *operator new[](size_t size) throw(std::bad_alloc) { void *ptr = UPP::MemoryAlloc(size); return ptr; }
inline void operator delete[](void *ptr) throw() { UPP::MemoryFree(ptr); }
inline void *operator new(size_t size, const std::nothrow_t&) throw() { void *ptr = UPP::MemoryAlloc(size); return ptr; }
inline void operator delete(void *ptr, const std::nothrow_t&) throw() { UPP::MemoryFree(ptr); }
inline void *operator new[](size_t size, const std::nothrow_t&) throw() { void *ptr = UPP::MemoryAlloc(size); return ptr; }
inline void operator delete[](void *ptr, const std::nothrow_t&) throw() { UPP::MemoryFree(ptr); }
#endif
NAMESPACE_UPP
class XmlIO;
class JsonIO;

View file

@ -278,3 +278,20 @@ void MemoryCheck()
#endif
END_UPP_NAMESPACE
#ifdef UPP_HEAP
#include <new>
void *operator new(size_t size) throw(std::bad_alloc) { void *ptr = UPP::MemoryAlloc(size); return ptr; }
void operator delete(void *ptr) throw() { UPP::MemoryFree(ptr); }
void *operator new[](size_t size) throw(std::bad_alloc) { void *ptr = UPP::MemoryAlloc(size); return ptr; }
void operator delete[](void *ptr) throw() { UPP::MemoryFree(ptr); }
void *operator new(size_t size, const std::nothrow_t&) throw() { void *ptr = UPP::MemoryAlloc(size); return ptr; }
void operator delete(void *ptr, const std::nothrow_t&) throw() { UPP::MemoryFree(ptr); }
void *operator new[](size_t size, const std::nothrow_t&) throw() { void *ptr = UPP::MemoryAlloc(size); return ptr; }
void operator delete[](void *ptr, const std::nothrow_t&) throw() { UPP::MemoryFree(ptr); }
#endif

View file

@ -0,0 +1,13 @@
PREMULTIPLIED
IMAGE_ID(EB)
IMAGE_ID(EBh)
IMAGE_ID(EBp)
IMAGE_ID(EBd)
IMAGE_ID(EFE)
IMAGE_ID(VE)
IMAGE_BEGIN_DATA
IMAGE_DATA(120,156,99,96,101,96,101,96,2,66,16,56,112,224,192,127,90,99,6,98,44,124,248,224,1,28,147,42,134,215,194,134)
IMAGE_DATA(134,134,255,216,48,178,6,82,197,208,49,138,133,211,166,77,251,79,107,140,98,33,186,47,97,124,92,190,129,69,3,46)
IMAGE_DATA(31,98,51,143,238,22,2,0,203,29,159,243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
IMAGE_END_DATA(96, 6)

View file

@ -10,6 +10,14 @@
NAMESPACE_UPP
#define IMAGECLASS AmbientCtrlsImg
#define IMAGEFILE <CtrlLib/AmbientCtrls.iml>
#include <Draw/iml_header.h>
#define IMAGECLASS AmbientCtrlsImg
#define IMAGEFILE <CtrlLib/AmbientCtrls.iml>
#include <Draw/iml_source.h>
extern int gtk_antialias;
extern int gtk_hinting;
extern String gtk_hintstyle;
@ -145,6 +153,10 @@ void ChHostSkin()
ColoredOverride(CtrlsImg::Iml(), CtrlsImg::Iml());
int classiq = engine == "Redmond" || engine == "Raleigh" || engine == "Glider" || engine == "Simple";
if(!classiq)
ColoredOverride(CtrlsImg::Iml(), AmbientCtrlsImg::Iml());
Color fc = Blend(SColorHighlight, SColorShadow);
ChGtkIs().Clear();
@ -182,9 +194,7 @@ void ChHostSkin()
}
Point po(0, 0);
int classiq = engine == "Redmond" || engine == "Raleigh" || engine == "Glider" || engine == "Simple";
{
Button::Style& s = Button::StyleNormal().Write();
s.overpaint = 3;
@ -474,6 +484,7 @@ void ChHostSkin()
}
int efm = 0;
if(engine.Find("oxygen") < 0)
{
EditField::Style& s = EditField::StyleDefault().Write();
Image img;
@ -512,6 +523,7 @@ void ChHostSkin()
s.sep2 = SColorShadow();
s.sep1 = SColorLight();
s.sepm = 4;
if(engine.Find("oxygen") < 0)
{
MultiButton::Style& s = MultiButton::StyleFrame().Write();
for(int i = 0; i < 4; i++)

View file

@ -70,11 +70,16 @@ void SetChGtkSpy_(void (*spy)(const char *name, int state, int shadow, const cha
chgtkspy__ = spy;
}
INITBLOCK { // This is required to avoid animation related problems with Oxygen-GTK theme
setenv("OXYGEN_APPLICATION_NAME_OVERRIDE", "firefox", 1);
}
Image GetGTK(GtkWidget *widget, int state, int shadow, const char *detail, int type, int cx, int cy,
Rect rect)
{
MemoryIgnoreLeaksBlock __;
GdkPixbuf *icon = NULL;
if(type == GTK_ICON || type == GTK_THEMEICON) {
gtk_widget_set_sensitive(widget, 1);
gtk_widget_set_state(widget, GTK_STATE_NORMAL);
@ -91,6 +96,7 @@ Image GetGTK(GtkWidget *widget, int state, int shadow, const char *detail, int t
gtk_widget_set_sensitive(widget, state != 4);
gtk_widget_set_state(widget, (GtkStateType)state);
}
int ht = type & 0xf000;
int rcx, rcy;
int margin = (type >> 4) & 7;

View file

@ -113,6 +113,7 @@ file
ChGtk0.cpp,
ChGtk.cpp,
ClassicCtrls.iml,
AmbientCtrls.iml,
Meta readonly separator,
Normal.upt,
Complex.upt,

View file

@ -1,4 +1,4 @@
description "Utility for U++ enterprise application update system";
description "Utility for U++ enterprise application update system\377";
uses
CtrlLib;