Changeset View
Changeset View
Standalone View
Standalone View
widgets/toolbars/kpColorToolBar.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 53 | { | |||
---|---|---|---|---|---|
61 | QWidget *base = new QWidget (this); | 61 | QWidget *base = new QWidget (this); | ||
62 | m_boxLayout = new QBoxLayout (QBoxLayout::LeftToRight, base); | 62 | m_boxLayout = new QBoxLayout (QBoxLayout::LeftToRight, base); | ||
63 | m_boxLayout->setMargin (5); | 63 | m_boxLayout->setMargin (5); | ||
64 | m_boxLayout->setSpacing (10 * 3); | 64 | m_boxLayout->setSpacing (10 * 3); | ||
65 | 65 | | |||
66 | // This holds the current global foreground and background colors, for | 66 | // This holds the current global foreground and background colors, for | ||
67 | // tools. | 67 | // tools. | ||
68 | m_dualColorButton = new kpDualColorButton (base); | 68 | m_dualColorButton = new kpDualColorButton (base); | ||
69 | connect (m_dualColorButton, SIGNAL (colorsSwapped(kpColor,kpColor)), | 69 | connect (m_dualColorButton, &kpDualColorButton::colorsSwapped, | ||
70 | this, SIGNAL (colorsSwapped(kpColor,kpColor))); | 70 | this, &kpColorToolBar::colorsSwapped); | ||
71 | connect (m_dualColorButton, SIGNAL (foregroundColorChanged(kpColor)), | 71 | | ||
72 | this, SIGNAL (foregroundColorChanged(kpColor))); | 72 | connect (m_dualColorButton, &kpDualColorButton::foregroundColorChanged, | ||
73 | connect (m_dualColorButton, SIGNAL (backgroundColorChanged(kpColor)), | 73 | this, &kpColorToolBar::foregroundColorChanged); | ||
74 | this, SIGNAL (backgroundColorChanged(kpColor))); | 74 | | ||
75 | connect (m_dualColorButton, &kpDualColorButton::backgroundColorChanged, | ||||
76 | this, &kpColorToolBar::backgroundColorChanged); | ||||
77 | | ||||
75 | m_boxLayout->addWidget (m_dualColorButton, 0/*stretch*/, Qt::AlignVCenter); | 78 | m_boxLayout->addWidget (m_dualColorButton, 0/*stretch*/, Qt::AlignVCenter); | ||
76 | 79 | | |||
77 | m_colorPalette = new kpColorPalette (base); | 80 | m_colorPalette = new kpColorPalette (base); | ||
78 | connect (m_colorPalette, SIGNAL (foregroundColorChanged(kpColor)), | 81 | connect (m_colorPalette, &kpColorPalette::foregroundColorChanged, | ||
79 | m_dualColorButton, SLOT (setForegroundColor(kpColor))); | 82 | m_dualColorButton, &kpDualColorButton::setForegroundColor); | ||
80 | connect (m_colorPalette, SIGNAL (backgroundColorChanged(kpColor)), | 83 | | ||
81 | m_dualColorButton, SLOT (setBackgroundColor(kpColor))); | 84 | connect (m_colorPalette, &kpColorPalette::backgroundColorChanged, | ||
82 | 85 | m_dualColorButton, &kpDualColorButton::setBackgroundColor); | |||
83 | connect (m_colorPalette->colorCells (), SIGNAL (isModifiedChanged(bool)), | 86 | | ||
84 | SLOT (updateNameOrUrlLabel())); | 87 | connect (m_colorPalette->colorCells (), &kpColorCells::isModifiedChanged, | ||
85 | connect (m_colorPalette->colorCells (), SIGNAL (urlChanged(QUrl)), | 88 | this, &kpColorToolBar::updateNameOrUrlLabel); | ||
86 | SLOT (updateNameOrUrlLabel())); | 89 | | ||
87 | connect (m_colorPalette->colorCells (), SIGNAL (nameChanged(QString)), | 90 | connect (m_colorPalette->colorCells (), &kpColorCells::urlChanged, | ||
88 | SLOT (updateNameOrUrlLabel())); | 91 | this, &kpColorToolBar::updateNameOrUrlLabel); | ||
92 | | ||||
93 | connect (m_colorPalette->colorCells (), &kpColorCells::nameChanged, | ||||
94 | this, &kpColorToolBar::updateNameOrUrlLabel); | ||||
95 | | ||||
89 | updateNameOrUrlLabel (); | 96 | updateNameOrUrlLabel (); | ||
90 | 97 | | |||
91 | m_boxLayout->addWidget (m_colorPalette, 0/*stretch*/); | 98 | m_boxLayout->addWidget (m_colorPalette, 0/*stretch*/); | ||
92 | 99 | | |||
93 | m_colorSimilarityToolBarItem = new kpColorSimilarityToolBarItem (base); | 100 | m_colorSimilarityToolBarItem = new kpColorSimilarityToolBarItem (base); | ||
94 | connect (m_colorSimilarityToolBarItem, SIGNAL (colorSimilarityChanged(double,int)), | 101 | connect (m_colorSimilarityToolBarItem, | ||
95 | this, SIGNAL (colorSimilarityChanged(double,int))); | 102 | &kpColorSimilarityToolBarItem::colorSimilarityChanged, | ||
103 | this, &kpColorToolBar::colorSimilarityChanged); | ||||
104 | | ||||
96 | m_boxLayout->addWidget (m_colorSimilarityToolBarItem, 0/*stretch*/); | 105 | m_boxLayout->addWidget (m_colorSimilarityToolBarItem, 0/*stretch*/); | ||
97 | 106 | | |||
98 | // Pad out all the horizontal space on the right of the Color Tool Bar so that | 107 | // Pad out all the horizontal space on the right of the Color Tool Bar so that | ||
99 | // that the real Color Tool Bar widgets aren't placed in the center of the | 108 | // that the real Color Tool Bar widgets aren't placed in the center of the | ||
100 | // Color Tool Bar. | 109 | // Color Tool Bar. | ||
101 | m_boxLayout->addItem ( | 110 | m_boxLayout->addItem ( | ||
102 | new QSpacerItem (1, 1, QSizePolicy::Expanding, QSizePolicy::Preferred)); | 111 | new QSpacerItem (1, 1, QSizePolicy::Expanding, QSizePolicy::Preferred)); | ||
103 | 112 | | |||
▲ Show 20 Lines • Show All 225 Lines • Show Last 20 Lines |