365
382
void ViewAdaptor::setSelectionTextColor(const QColor& txtColor)
367
m_view->setSelectionTextColor(txtColor);
384
StyleCommand* command = new StyleCommand();
385
command->setSheet(m_view->activeSheet());
386
command->setText(i18n("Change Text Color"));
387
command->setFontColor(txtColor);
388
command->add(*m_view->selection());
370
392
void ViewAdaptor::setSelectionBgColor(const QColor& bgColor)
372
m_view->setSelectionBackgroundColor(bgColor);
394
StyleCommand* command = new StyleCommand();
395
command->setSheet(m_view->activeSheet());
396
command->setText(i18n("Change Background Color"));
397
command->setBackgroundColor(bgColor);
398
command->add(*m_view->selection());
375
void ViewAdaptor::setSelectionBorderColor(const QColor& bdColor)
402
void ViewAdaptor::setSelectionBorderColor(const QColor& bgColor)
377
m_view->setSelectionBorderColor(bdColor);
404
StyleCommand* command = new StyleCommand();
405
command->setSheet(m_view->activeSheet());
406
command->setText(i18n("Change Background Color"));
407
command->setBackgroundColor(bgColor);
408
command->add(*m_view->selection());
380
412
#if 0 // -> cell tool
397
429
void ViewAdaptor::setLeftBorderColor(const QColor& color)
399
m_view->setSelectionLeftBorderColor(color);
431
StyleCommand* command = new StyleCommand();
432
command->setSheet(m_view->activeSheet());
433
command->setText(i18n("Change Border"));
434
if (m_view->activeSheet()->layoutDirection() == Qt::RightToLeft)
435
command->setRightBorderPen(QPen(color, 1, Qt::SolidLine));
437
command->setLeftBorderPen(QPen(color, 1, Qt::SolidLine));
438
command->add(*m_view->selection());
402
442
void ViewAdaptor::setTopBorderColor(const QColor& color)
404
m_view->setSelectionTopBorderColor(color);
444
StyleCommand* command = new StyleCommand();
445
command->setSheet(m_view->activeSheet());
446
command->setText(i18n("Change Border"));
447
command->setTopBorderPen(QPen(color, 1, Qt::SolidLine));
448
command->add(*m_view->selection());
407
452
void ViewAdaptor::setRightBorderColor(const QColor& color)
409
m_view->setSelectionRightBorderColor(color);
454
StyleCommand* command = new StyleCommand();
455
command->setSheet(m_view->activeSheet());
456
command->setText(i18n("Change Border"));
457
if (m_view->activeSheet()->layoutDirection() == Qt::RightToLeft)
458
command->setLeftBorderPen(QPen(color, 1, Qt::SolidLine));
460
command->setRightBorderPen(QPen(color, 1, Qt::SolidLine));
461
command->add(*m_view->selection());
412
465
void ViewAdaptor::setBottomBorderColor(const QColor& color)
414
m_view->setSelectionBottomBorderColor(color);
467
StyleCommand* command = new StyleCommand();
468
command->setSheet(m_view->activeSheet());
469
command->setText(i18n("Change Border"));
470
command->setBottomBorderPen(QPen(color, 1, Qt::SolidLine));
471
command->add(*m_view->selection());
417
475
void ViewAdaptor::setAllBorderColor(const QColor& color)
419
m_view->setSelectionAllBorderColor(color);
477
StyleCommand* command = new StyleCommand();
478
command->setSheet(m_view->activeSheet());
479
command->setText(i18n("Change Border"));
480
command->setTopBorderPen(QPen(color, 1, Qt::SolidLine));
481
command->setBottomBorderPen(QPen(color, 1, Qt::SolidLine));
482
command->setLeftBorderPen(QPen(color, 1, Qt::SolidLine));
483
command->setRightBorderPen(QPen(color, 1, Qt::SolidLine));
484
command->setHorizontalPen(QPen(color, 1, Qt::SolidLine));
485
command->setVerticalPen(QPen(color, 1, Qt::SolidLine));
486
command->add(*m_view->selection());
422
490
void ViewAdaptor::setOutlineBorderColor(const QColor& color)
424
m_view->setSelectionOutlineBorderColor(color);
492
StyleCommand* command = new StyleCommand();
493
command->setSheet(m_view->activeSheet());
494
command->setText(i18n("Change Border"));
495
command->setTopBorderPen(QPen(color, 1, Qt::SolidLine));
496
command->setBottomBorderPen(QPen(color, 1, Qt::SolidLine));
497
command->setLeftBorderPen(QPen(color, 1, Qt::SolidLine));
498
command->setRightBorderPen(QPen(color, 1, Qt::SolidLine));
499
command->add(*m_view->selection());
427
503
#if 0 // -> cell tool