aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Basemenu.cc46
1 files changed, 25 insertions, 21 deletions
diff --git a/src/Basemenu.cc b/src/Basemenu.cc
index f804f3d..d35c403 100644
--- a/src/Basemenu.cc
+++ b/src/Basemenu.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Basemenu.cc,v 1.36 2002/11/26 16:07:29 fluxgen Exp $ 25// $Id: Basemenu.cc,v 1.37 2002/11/27 22:06:06 fluxgen Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -307,54 +307,58 @@ void Basemenu::update() {
307 if (menu.height < 1) menu.height = 1; 307 if (menu.height < 1) menu.height = 1;
308 308
309 Pixmap tmp; 309 Pixmap tmp;
310 FbTk::Texture *texture;
311 if (title_vis) { 310 if (title_vis) {
312 tmp = menu.title_pixmap; 311 tmp = menu.title_pixmap;
313 texture = &(m_screen->getMenuStyle()->title); 312 const FbTk::Texture &tex = m_screen->getMenuStyle()->title;
314 if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { 313 if (tex.type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) {
315 menu.title_pixmap = None; 314 menu.title_pixmap = None;
316 XSetWindowBackground(m_display, menu.title, 315 XSetWindowBackground(m_display, menu.title, tex.color().pixel());
317 texture->color().pixel());
318 } else { 316 } else {
319 menu.title_pixmap = 317 menu.title_pixmap =
320 m_image_ctrl->renderImage(menu.width, menu.title_h, texture); 318 m_image_ctrl->renderImage(menu.width, menu.title_h, tex);
321 XSetWindowBackgroundPixmap(m_display, menu.title, menu.title_pixmap); 319 XSetWindowBackgroundPixmap(m_display, menu.title, menu.title_pixmap);
322 } 320 }
323 if (tmp) m_image_ctrl->removeImage(tmp); 321
322 if (tmp)
323 m_image_ctrl->removeImage(tmp);
324
324 XClearWindow(m_display, menu.title); 325 XClearWindow(m_display, menu.title);
325 } 326 }
326 327
327 tmp = menu.frame_pixmap; 328 tmp = menu.frame_pixmap;
328 texture = &(m_screen->getMenuStyle()->frame); 329 const FbTk::Texture &frame_tex = m_screen->getMenuStyle()->frame;
329 if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { 330 if (frame_tex.type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) {
330 menu.frame_pixmap = None; 331 menu.frame_pixmap = None;
331 XSetWindowBackground(m_display, menu.frame, 332 XSetWindowBackground(m_display, menu.frame, frame_tex.color().pixel());
332 texture->color().pixel());
333 } else { 333 } else {
334 menu.frame_pixmap = 334 menu.frame_pixmap =
335 m_image_ctrl->renderImage(menu.width, menu.frame_h, texture); 335 m_image_ctrl->renderImage(menu.width, menu.frame_h, frame_tex);
336 XSetWindowBackgroundPixmap(m_display, menu.frame, menu.frame_pixmap); 336 XSetWindowBackgroundPixmap(m_display, menu.frame, menu.frame_pixmap);
337 } 337 }
338 if (tmp) m_image_ctrl->removeImage(tmp); 338
339 if (tmp)
340 m_image_ctrl->removeImage(tmp);
339 341
340 tmp = menu.hilite_pixmap; 342 tmp = menu.hilite_pixmap;
341 texture = &(m_screen->getMenuStyle()->hilite); 343 const FbTk::Texture &hilite_tex = m_screen->getMenuStyle()->hilite;
342 if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) 344 if (hilite_tex.type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID))
343 menu.hilite_pixmap = None; 345 menu.hilite_pixmap = None;
344 else 346 else
345 menu.hilite_pixmap = 347 menu.hilite_pixmap =
346 m_image_ctrl->renderImage(menu.item_w, menu.item_h, texture); 348 m_image_ctrl->renderImage(menu.item_w, menu.item_h, hilite_tex);
347 if (tmp) m_image_ctrl->removeImage(tmp); 349 if (tmp)
350 m_image_ctrl->removeImage(tmp);
348 351
349 tmp = menu.sel_pixmap; 352 tmp = menu.sel_pixmap;
350 if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) 353 if (hilite_tex.type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID))
351 menu.sel_pixmap = None; 354 menu.sel_pixmap = None;
352 else { 355 else {
353 int hw = menu.item_h / 2; 356 int hw = menu.item_h / 2;
354 menu.sel_pixmap = 357 menu.sel_pixmap =
355 m_image_ctrl->renderImage(hw, hw, texture); 358 m_image_ctrl->renderImage(hw, hw, hilite_tex);
356 } 359 }
357 if (tmp) m_image_ctrl->removeImage(tmp); 360 if (tmp)
361 m_image_ctrl->removeImage(tmp);
358 362
359 XResizeWindow(m_display, menu.window, menu.width, menu.height); 363 XResizeWindow(m_display, menu.window, menu.width, menu.height);
360 364