Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 43569
Collapse All | Expand All

(-)patch2/baghiraclient.cc (-29 / +39 lines)
Lines 929-935 Link Here
929
	// setup layout
929
	// setup layout
930
	QVBoxLayout *mainlayout = new QVBoxLayout( widget() );
930
	QVBoxLayout *mainlayout = new QVBoxLayout( widget() );
931
	QHBoxLayout *titlelayout = new QHBoxLayout();
931
	QHBoxLayout *titlelayout = new QHBoxLayout();
932
	QHBoxLayout *windowlayout = new QHBoxLayout();
932
//	QHBoxLayout *windowlayout = new QHBoxLayout();
933
	windowlayout = new QHBoxLayout();
933
934
934
	titlebar_ = new QSpacerItem( 1, titleheight_, QSizePolicy::Expanding,
935
	titlebar_ = new QSpacerItem( 1, titleheight_, QSizePolicy::Expanding,
935
	                             QSizePolicy::Fixed );
936
	                             QSizePolicy::Fixed );
Lines 964-975 Link Here
964
	addButtons( titlelayout, options() ->titleButtonsRight() );
965
	addButtons( titlelayout, options() ->titleButtonsRight() );
965
966
966
	if ( BaghiraFactory::bgStipple() ) {
967
	if ( BaghiraFactory::bgStipple() ) {
967
		HandlePix = QPixmap( HANDLESIZE, HANDLESIZE );
968
		HandlePix = QPixmap( HANDLESIZE > 0 ? HANDLESIZE : 1, HANDLESIZE > 4 ? HANDLESIZE : 4);
968
		QPainter painter;
969
		QPainter painter;
969
		painter.begin( &HandlePix );
970
		painter.begin( &HandlePix );
970
		painter.fillRect( HandlePix.rect(), widget() ->colorGroup().background() );
971
		painter.fillRect( HandlePix.rect(), widget() ->colorGroup().background() );
971
		painter.setPen( widget() ->colorGroup().background().dark( 100 +
972
		painter.setPen( widget()->colorGroup().background().dark( 100 + BaghiraFactory::contrast() ) );
972
		                BaghiraFactory::contrast() ) );
973
		for ( int i = 0; i < HandlePix.height(); i += 4 ) {
973
		for ( int i = 0; i < HandlePix.height(); i += 4 ) {
974
			painter.drawLine( 0, i, HandlePix.width() - 1, i );
974
			painter.drawLine( 0, i, HandlePix.width() - 1, i );
975
			painter.drawLine( 0, i + 1, HandlePix.width() - 1, i + 1 );
975
			painter.drawLine( 0, i + 1, HandlePix.width() - 1, i + 1 );
Lines 1196-1207 Link Here
1196
	y2 = title.bottom();
1196
	y2 = title.bottom();
1197
	int b = height()-2;
1197
	int b = height()-2;
1198
1198
1199
	const QColor *ttbar = &(options()->color(ColorTitleBar, isActive()));
1199
	group = options() ->colorGroup( ColorTitleBar, isActive() );
1200
	group = options() ->colorGroup( ColorTitleBar, isActive() );
1200
	painter.setPen( group.midlight() );
1201
	painter.setPen( ttbar->light(120) );
1201
	painter.drawLine( x, y, x, y2 );
1202
	painter.drawLine( x, y, x, y2 );
1202
	painter.setPen( group.light() );
1203
	painter.setPen( ttbar->light(110) );
1203
	painter.drawRect( title );
1204
	painter.drawLine( x,y,x2,y );
1205
	painter.drawLine( x2,y,x2,y2 );
1204
1206
1207
	
1205
	// draw around the corners ;-)
1208
	// draw around the corners ;-)
1206
	
1209
	
1207
	if (BaghiraFactory::shapeUL()){
1210
	if (BaghiraFactory::shapeUL()){
Lines 1239-1246 Link Here
1239
	painter.drawPoint(w - 2, b-4);
1242
	painter.drawPoint(w - 2, b-4);
1240
	}
1243
	}
1241
1244
1242
	painter.setPen( group.shadow() );
1245
	const QColor *ttblend = &(options()->color(ColorTitleBar, isActive()));
1243
	painter.drawLine( x+left.width(), y2, x2-right.width(), y2 );
1246
	painter.setPen( ttblend->dark(180) );
1247
	painter.drawLine( x+1, y2, x2-1, y2 );
1244
1248
1245
	// draw title text
1249
	// draw title text
1246
	titlebar_->geometry().rect( &x, &y, &w, &h );
1250
	titlebar_->geometry().rect( &x, &y, &w, &h );
Lines 1259-1279 Link Here
1259
	painter.fillRect( title.x(), y + 1, x - title.x()+5, h - 2, options()->color( ColorTitleBar, isActive() ) );
1263
	painter.fillRect( title.x(), y + 1, x - title.x()+5, h - 2, options()->color( ColorTitleBar, isActive() ) );
1260
	painter.fillRect( x+w-5, y + 1, title.right() - w + 5, h - 2, options()->color( ColorTitleBar, isActive() ) );
1264
	painter.fillRect( x+w-5, y + 1, title.right() - w + 5, h - 2, options()->color( ColorTitleBar, isActive() ) );
1261
	}
1265
	}
1262
	
1266
	ICONX = iconLeft;
1263
	painter.drawPixmap( iconLeft, y + ( titleheight_ - 16 ) / 2, icon().pixmap( QIconSet::Small, QIconSet::Normal ) );
1267
	ICONY = y + ( titleheight_ - 16 ) / 2;
1268
	painter.drawPixmap( ICONX, ICONY, icon().pixmap( QIconSet::Small, QIconSet::Normal ) );
1264
1269
1265
	painter.drawText( x + 2 * MARGIN + 16/* - excursion*/, y, w - MARGIN * 2 - 16, h, BaghiraFactory::titleAlign() | AlignVCenter, caption() );
1270
	painter.drawText( x + 2 * MARGIN + 16/* - excursion*/, y, w - MARGIN * 2 - 16, h, BaghiraFactory::titleAlign() | AlignVCenter, caption() );
1266
1271
1267
	// draw outer frame
1272
	// draw outer frame
1268
	if ( !isShade() ) {
1273
	if ( !isShade() ) {
1269
		group = options() ->colorGroup( ColorFrame, isActive() );
1274
//		group = options() ->colorGroup( ColorFrame, isActive() );
1275
		QColor background = widget() ->colorGroup().background();
1270
1276
1271
		// left side
1277
		// left side
1272
		left.rect( &x, &y, &w, &h );
1278
		left.rect( &x, &y, &w, &h );
1273
		x2 = left.right();
1279
		x2 = left.right();
1274
		y2 = left.bottom();
1280
		y2 = left.bottom();
1275
		BaghiraFactory::bgStipple() ? painter.drawTiledPixmap( x, y, w, h, HandlePix ) :
1281
		BaghiraFactory::bgStipple() ? painter.drawTiledPixmap( x, y, w, h, HandlePix ) :
1276
		painter.fillRect( x, y, w, h, widget() ->colorGroup().background() );
1282
		painter.fillRect( x, y, w, h, background );
1277
		//        painter.setPen(group.shadow());
1283
		//        painter.setPen(group.shadow());
1278
		//        painter.drawLine(x, y, x, y2);
1284
		//        painter.drawLine(x, y, x, y2);
1279
1285
Lines 1282-1294 Link Here
1282
		x2 = right.right();
1288
		x2 = right.right();
1283
		y2 = right.bottom();
1289
		y2 = right.bottom();
1284
		BaghiraFactory::bgStipple() ? painter.drawTiledPixmap( x, y, w, h, HandlePix ) :
1290
		BaghiraFactory::bgStipple() ? painter.drawTiledPixmap( x, y, w, h, HandlePix ) :
1285
		painter.fillRect( x, y, w, h, widget() ->colorGroup().background() );
1291
		painter.fillRect( x, y, w, h, background );
1286
		//        painter.drawLine(x2, y, x2, y2);
1292
		//        painter.drawLine(x2, y, x2, y2);
1287
	}
1293
//	}
1288
1294
1289
	// draw handle =====================================================
1295
	// draw handle =====================================================
1290
	// bottom bar
1296
	// bottom bar
1291
	if ( !isShade() ) {
1297
//	if ( !isShade() ) {
1292
		// handle middle
1298
		// handle middle
1293
		handle.rect( &x, &y, &w, &h );
1299
		handle.rect( &x, &y, &w, &h );
1294
		x += 15;
1300
		x += 15;
Lines 1298-1304 Link Here
1298
1304
1299
		group = options() ->colorGroup( ColorHandle, isActive() );
1305
		group = options() ->colorGroup( ColorHandle, isActive() );
1300
		BaghiraFactory::bgStipple() ? painter.drawTiledPixmap( x, y, w, h, HandlePix ) :
1306
		BaghiraFactory::bgStipple() ? painter.drawTiledPixmap( x, y, w, h, HandlePix ) :
1301
		painter.fillRect( x, y, w, h, widget() ->colorGroup().background() );
1307
		painter.fillRect( x, y, w, h, background );
1302
1308
1303
		//	painter.setPen(group.shadow());
1309
		//	painter.setPen(group.shadow());
1304
		//        painter.drawLine(x, y2, x2, y2);
1310
		//        painter.drawLine(x, y2, x2, y2);
Lines 1315-1321 Link Here
1315
		if ( drawHandlerBar ) {
1321
		if ( drawHandlerBar ) {
1316
			group = options() ->colorGroup( ColorFrame, isActive() );
1322
			group = options() ->colorGroup( ColorFrame, isActive() );
1317
1323
1318
			painter.fillRect( x, y, w, h, group.background() );
1324
			painter.fillRect( x, y, w, h, background );
1319
1325
1320
			painter.setPen( group.mid() );
1326
			painter.setPen( group.mid() );
1321
			painter.drawLine( x2, y, x2, y2 );
1327
			painter.drawLine( x2, y, x2, y2 );
Lines 1491-1505 Link Here
1491
}
1497
}
1492
1498
1493
void BaghiraClient::createOverlay(){
1499
void BaghiraClient::createOverlay(){
1494
/*inactiveOverlay = new QWidget(0, 0, WStyle_Customize | WStyle_NoBorder );
1500
/*inactiveOverlay = new QWidget(widget(), 0, WStyle_Customize);
1495
inactiveOverlay->setGeometry(geometry());
1501
inactiveOverlay->setGeometry(/*geometry().x(), geometry().y()+titleheight_,*\/0,0,geometry().width(), geometry().height()-titleheight_);
1496
inactiveOverlay->installEventFilter( this );
1502
inactiveOverlay->installEventFilter( this );
1497
QPixmap fadePixmap = QPixmap::grabWindow(inactiveOverlay->winId());
1503
QPixmap fadePixmap = QPixmap::grabWindow(inactiveOverlay->winId(),0,titleheight_,width(),height()-titleheight_);
1498
KPixmapEffect::desaturate( (KPixmap&) fadePixmap, 0.8 );
1504
KPixmapEffect::desaturate( (KPixmap&) fadePixmap, 0.8 );
1499
inactiveOverlay->setErasePixmap(fadePixmap);
1505
//inactiveOverlay->setErasePixmap(fadePixmap);
1500
XMapWindow(qt_xdisplay(), inactiveOverlay->winId());
1506
windowlayout->insertWidget(1,inactiveOverlay,1);
1501
XReparentWindow(qt_xdisplay(), inactiveOverlay->winId(), widget()->winId(), 0, 0 );
1507
//XMapWindow(qt_xdisplay(), inactiveOverlay->winId());
1502
//inactiveOverlay->show();
1508
//XReparentWindow(qt_xdisplay(), inactiveOverlay->winId(), widget()->winId(), 0, 0 );
1509
inactiveOverlay->show();
1503
qWarning("setting faded TRUE");
1510
qWarning("setting faded TRUE");
1504
isFaded = true;*/
1511
isFaded = true;*/
1505
/*
1512
/*
Lines 1518-1525 Link Here
1518
1525
1519
void BaghiraClient::removeOverlay(){
1526
void BaghiraClient::removeOverlay(){
1520
/*	if (inactiveOverlay){
1527
/*	if (inactiveOverlay){
1521
//		inactiveOverlay->hide();
1528
		inactiveOverlay->hide();
1522
		XUnmapWindow(qt_xdisplay(), inactiveOverlay->winId());
1529
//		XUnmapWindow(qt_xdisplay(), inactiveOverlay->winId());
1530
		windowlayout->remove(inactiveOverlay);
1523
		delete inactiveOverlay;
1531
		delete inactiveOverlay;
1524
		qWarning("setting faded FALSE (2)");
1532
		qWarning("setting faded FALSE (2)");
1525
		isFaded = false;
1533
		isFaded = false;
Lines 1557-1566 Link Here
1557
// The title has changed
1565
// The title has changed
1558
1566
1559
void BaghiraClient::iconChange() {
1567
void BaghiraClient::iconChange() {
1560
	if ( button[ MenuButton ] ) {
1568
	QPainter painter( widget() );
1569
	painter.drawPixmap( ICONX, ICONY, icon().pixmap( QIconSet::Small, QIconSet::Normal ) );
1570
/*	if ( button[ MenuButton ] ) {
1561
		button[ MenuButton ] ->setIcon();
1571
		button[ MenuButton ] ->setIcon();
1562
		button[ MenuButton ] ->repaint( false );
1572
		button[ MenuButton ] ->repaint( false );
1563
	}
1573
	}*/
1564
}
1574
}
1565
1575
1566
//////////////////////////////////////////////////////////////////////////////
1576
//////////////////////////////////////////////////////////////////////////////
(-)patch2/baghiraclient.h (+2 lines)
Lines 303-308 Link Here
303
    int plusminus;
303
    int plusminus;
304
    bool isFaded;
304
    bool isFaded;
305
    QWidget *inactiveOverlay;
305
    QWidget *inactiveOverlay;
306
    QHBoxLayout *windowlayout;
307
    int ICONX, ICONY;
306
//    KDecorationBridge *myBridge_;
308
//    KDecorationBridge *myBridge_;
307
//    QImage* ActiveDecoImage_;
309
//    QImage* ActiveDecoImage_;
308
//    QImage* InactiveDecoImage_;
310
//    QImage* InactiveDecoImage_;

Return to bug 43569