fix xcb build; update button resources

This commit is contained in:
Vadim Lopatin 2014-03-18 09:16:00 +04:00
parent 27d2f64735
commit 67b4534b70
8 changed files with 940 additions and 916 deletions

View File

@ -161,11 +161,22 @@
<Compile Include="3rdparty\X11\xcb\xvmc.d" />
<Compile Include="3rdparty\X11\keysymdef.d" />
<Compile Include="3rdparty\X11\xcb\image.d" />
<Compile Include="src\dlangui\core\events.d" />
<Compile Include="..\DerelictFI\source\derelict\freeimage\freeimage.d">
<Link>3rdparty\DerelictFI\freeimage.d</Link>
</Compile>
<Compile Include="..\DerelictFI\source\derelict\freeimage\functions.d">
<Link>3rdparty\DerelictFI\functions.d</Link>
</Compile>
<Compile Include="..\DerelictFI\source\derelict\freeimage\types.d">
<Link>3rdparty\DerelictFI\types.d</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="src\dlangui\platforms\x11\" />
<Folder Include="3rdparty\DerelictUtil\" />
<Folder Include="3rdparty\DerelictGL3\" />
<Folder Include="3rdparty\DerelictFT\" />
<Folder Include="3rdparty\DerelictFI\" />
</ItemGroup>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -32,6 +32,12 @@ class XCBWindow : Window {
~this() {
Log.d("Destroying window");
}
/// request window redraw
override void invalidate() {
redraw();
}
bool create() {
uint mask;
uint values[2];
@ -169,11 +175,11 @@ class XCBWindow : Window {
cast(void*)title);
}
ColorDrawBuf _drawbuf;
void processExpose(xcb_expose_event_t * event) {
void redraw() {
if (!_drawbuf)
_drawbuf = new ColorDrawBuf(_dx, _dy);
_drawbuf.resize(_dx, _dy);
_drawbuf.fill(_backgroundColor);
Log.d("calling createImage");
createImage();
Log.d("done createImage");
@ -188,6 +194,11 @@ class XCBWindow : Window {
xcb_flush(_xcbconnection);
}
ColorDrawBuf _drawbuf;
void processExpose(xcb_expose_event_t * event) {
redraw();
}
}
private __gshared xcb_connection_t * _xcbconnection;

View File

@ -502,8 +502,10 @@ private __gshared Theme _currentTheme;
static this() {
_currentTheme = new Theme("default");
Style button = _currentTheme.createSubstyle("BUTTON").backgroundImageId("btn_default_normal").alignment(Align.Center);
Style button = _currentTheme.createSubstyle("BUTTON").backgroundImageId("btn_default_small_normal").alignment(Align.Center);
Style text = _currentTheme.createSubstyle("TEXT").margins(Rect(3,3,3,3)).padding(Rect(3,3,3,3));
button.createState(State.Pressed, State.Pressed).backgroundImageId("btn_default_pressed");
button.createState(State.Focused, State.Focused).backgroundImageId("btn_default_selected");
button.createState(State.Disabled | State.Focused, State.Disabled | State.Focused).backgroundImageId("btn_default_small_normal_disable_focused");
button.createState(State.Disabled, State.Disabled).backgroundImageId("btn_default_small_normal_disable");
button.createState(State.Pressed, State.Pressed).backgroundImageId("btn_default_small_pressed");
button.createState(State.Focused, State.Focused).backgroundImageId("btn_default_small_selected");
}