~bratsche/ubuntu/maverick/gtk2-engines-murrine/relicense

« back to all changes in this revision

Viewing changes to src/murrine_draw.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-03-24 16:09:39 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100324160939-9yv64xiee0zffrat
Tags: 0.90.3+git20100323-0ubuntu1
New git snapshot version to fix some theme issues (lp: #533484)

Show diffs side-by-side

added added

removed removed

Lines of Context:
401
401
                             int x, int y, int width, int height,
402
402
                             boolean horizontal)
403
403
{
 
404
        cairo_save (cr);
 
405
        
404
406
        widget->style_functions->draw_button (cr, colors, widget, x, y, width, height, horizontal);
405
407
 
 
408
        cairo_restore (cr);
 
409
 
406
410
        switch (spinbutton->style)
407
411
        {
408
412
                default:
443
447
                        if (height % 2 != 0)
444
448
                                height++;
445
449
 
446
 
                        cairo_move_to (cr, x+3, y+height/2.0-0.5);
447
 
                        cairo_line_to (cr, width-2,  y+height/2.0-0.5);
 
450
                        cairo_move_to (cr, x+2, y+height/2.0-0.5);
 
451
                        cairo_line_to (cr, width-3,  y+height/2.0-0.5);
448
452
                        murrine_set_color_rgb (cr, &line);
449
453
                        cairo_stroke (cr);
450
454
 
451
 
                        cairo_move_to (cr, x+4, y+height/2.0+0.5);
452
 
                        cairo_line_to (cr, width-3,  y+height/2.0+0.5);
 
455
                        cairo_move_to (cr, x+3, y+height/2.0+0.5);
 
456
                        cairo_line_to (cr, width-4,  y+height/2.0+0.5);
453
457
                        murrine_set_color_rgba (cr, &highlight, 0.5);
454
458
                        cairo_stroke (cr);
455
459
                        break;
814
818
                {
815
819
                        WidgetParameters params = widget;
816
820
                        MurrineColors colors_new = colors;
817
 
                        int box_w = combobox->box_w;
818
 
                        if (!(widget.xthickness > 2 && widget.ythickness > 2))
819
 
                                box_w -= 3;
 
821
                        int box_w = (widget.xthickness > 2 && widget.ythickness > 2) ? combobox->box_w : combobox->box_w-3;
820
822
                        int os = (widget.xthickness > 2 && widget.ythickness > 2) ? 1 : 0;
821
823
                        colors_new.bg[GTK_STATE_NORMAL] = colors.spot[1];
822
824
                        murrine_shade (&colors_new.bg[GTK_STATE_NORMAL], combobox->prelight_shade, 
823
825
                                       &colors_new.bg[GTK_STATE_PRELIGHT]);
824
826
 
 
827
                        if (combobox->as_list)
 
828
                        {
 
829
                                params.style_functions->draw_button (cr, &colors_new, &params, x, y, w, h, horizontal);
 
830
                                break;
 
831
                        }
 
832
 
825
833
                        cairo_save (cr);
826
834
                        if (params.ltr)
827
835
                        {
1382
1390
 
1383
1391
        if (separator->horizontal)
1384
1392
        {
1385
 
                cairo_translate       (cr, x, y+0.5);
1386
 
 
1387
 
                murrine_set_color_rgb (cr, dark);
1388
 
                cairo_move_to         (cr, 0.0,     0.0);
1389
 
                cairo_line_to         (cr, width+1, 0.0);
1390
 
                cairo_stroke          (cr);
1391
 
 
1392
 
                murrine_set_color_rgb (cr, highlight);
1393
 
                cairo_move_to         (cr, 0.0,   1.0);
1394
 
                cairo_line_to         (cr, width, 1.0);
1395
 
                cairo_stroke          (cr);
 
1393
                cairo_translate (cr, x, y+0.5);
 
1394
 
 
1395
                switch (separator->style)
 
1396
                {
 
1397
                        default:
 
1398
                        case 0:
 
1399
                                murrine_set_color_rgb (cr, dark);
 
1400
                                break;
 
1401
                        case 1:
 
1402
                        {
 
1403
                                cairo_pattern_t *pat;
 
1404
                                pat = cairo_pattern_create_linear (0, 0, width, 0);
 
1405
                                murrine_pattern_add_color_stop_rgba (pat, 0.00, dark, 0.0);
 
1406
                                murrine_pattern_add_color_stop_rgba (pat, 0.25, dark, 1.0);
 
1407
                                murrine_pattern_add_color_stop_rgba (pat, 0.75, dark, 1.0);
 
1408
                                murrine_pattern_add_color_stop_rgba (pat, 1.00, dark, 0.0);
 
1409
                                cairo_set_source (cr, pat);
 
1410
                                cairo_pattern_destroy (pat);
 
1411
                                break;
 
1412
                        }
 
1413
                }
 
1414
                
 
1415
                cairo_move_to (cr, 0.0,     0.0);
 
1416
                cairo_line_to (cr, width+1, 0.0);
 
1417
                cairo_stroke  (cr);
 
1418
 
 
1419
                switch (separator->style)
 
1420
                {
 
1421
                        default:
 
1422
                        case 0:
 
1423
                                murrine_set_color_rgb (cr, highlight);
 
1424
                                break;
 
1425
                        case 1:
 
1426
                        {
 
1427
                                cairo_pattern_t *pat;
 
1428
                                pat = cairo_pattern_create_linear (0, 0, width, 0);
 
1429
                                murrine_pattern_add_color_stop_rgba (pat, 0.00, highlight, 0.0);
 
1430
                                murrine_pattern_add_color_stop_rgba (pat, 0.25, highlight, 1.0);
 
1431
                                murrine_pattern_add_color_stop_rgba (pat, 0.75, highlight, 1.0);
 
1432
                                murrine_pattern_add_color_stop_rgba (pat, 1.00, highlight, 0.0);
 
1433
                                cairo_set_source (cr, pat);
 
1434
                                cairo_pattern_destroy (pat);
 
1435
                                break;
 
1436
                        }
 
1437
                }
 
1438
 
 
1439
                cairo_move_to (cr, 0.0,   1.0);
 
1440
                cairo_line_to (cr, width, 1.0);
 
1441
                cairo_stroke  (cr);
1396
1442
        }
1397
1443
        else
1398
1444
        {
1399
 
                cairo_translate       (cr, x+0.5, y);
1400
 
 
1401
 
                murrine_set_color_rgb (cr, dark);
1402
 
                cairo_move_to         (cr, 0.0, 0.0);
1403
 
                cairo_line_to         (cr, 0.0, height);
1404
 
                cairo_stroke          (cr);
1405
 
 
1406
 
                murrine_set_color_rgb (cr, highlight);
1407
 
                cairo_move_to         (cr, 1.0, 0.0);
1408
 
                cairo_line_to         (cr, 1.0, height);
1409
 
                cairo_stroke          (cr);
 
1445
                cairo_translate (cr, x+0.5, y);
 
1446
 
 
1447
                switch (separator->style)
 
1448
                {
 
1449
                        default:
 
1450
                        case 0:
 
1451
                                murrine_set_color_rgb (cr, dark);
 
1452
                                break;
 
1453
                        case 1:
 
1454
                        {
 
1455
                                cairo_pattern_t *pat;
 
1456
                                pat = cairo_pattern_create_linear (0, 0, 0, height);
 
1457
                                murrine_pattern_add_color_stop_rgba (pat, 0.00, dark, 0.0);
 
1458
                                murrine_pattern_add_color_stop_rgba (pat, 0.25, dark, 1.0);
 
1459
                                murrine_pattern_add_color_stop_rgba (pat, 0.75, dark, 1.0);
 
1460
                                murrine_pattern_add_color_stop_rgba (pat, 1.00, dark, 0.0);
 
1461
                                cairo_set_source (cr, pat);
 
1462
                                cairo_pattern_destroy (pat);
 
1463
                                break;
 
1464
                        }
 
1465
                }
 
1466
                cairo_move_to (cr, 0.0, 0.0);
 
1467
                cairo_line_to (cr, 0.0, height);
 
1468
                cairo_stroke  (cr);
 
1469
 
 
1470
                switch (separator->style)
 
1471
                {
 
1472
                        default:
 
1473
                        case 0:
 
1474
                                murrine_set_color_rgb (cr, highlight);
 
1475
                                break;
 
1476
                        case 1:
 
1477
                        {
 
1478
                                cairo_pattern_t *pat;
 
1479
                                pat = cairo_pattern_create_linear (0, 0, 0, height);
 
1480
                                murrine_pattern_add_color_stop_rgba (pat, 0.00, highlight, 0.0);
 
1481
                                murrine_pattern_add_color_stop_rgba (pat, 0.25, highlight, 1.0);
 
1482
                                murrine_pattern_add_color_stop_rgba (pat, 0.75, highlight, 1.0);
 
1483
                                murrine_pattern_add_color_stop_rgba (pat, 1.00, highlight, 0.0);
 
1484
                                cairo_set_source (cr, pat);
 
1485
                                cairo_pattern_destroy (pat);
 
1486
                                break;
 
1487
                        }
 
1488
                }
 
1489
 
 
1490
                cairo_move_to (cr, 1.0, 0.0);
 
1491
                cairo_line_to (cr, 1.0, height);
 
1492
                cairo_stroke  (cr);
1410
1493
        }
1411
1494
}
1412
1495