240 changes: 155 additions & 85 deletions src/libkstapp/themedialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<rect>
<x>0</x>
<y>0</y>
<width>575</width>
<height>336</height>
<width>879</width>
<height>268</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
Expand All @@ -36,104 +36,174 @@
</layout>
</item>
<item>
<widget class="QGroupBox" name="_fontBox">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Fonts</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="_Label_11">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QGroupBox" name="_curveBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="title">
<string>Curve</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Fo&amp;nt size:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>_labelFontScale</cstring>
<string>Default Color:</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QDoubleSpinBox" name="_labelFontScale">
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>-25.000000000000000</double>
<item>
<widget class="QComboBox" name="_curveColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="_Label_12">
<property name="text">
<string>Font fa&amp;mily:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>_family</cstring>
</property>
</widget>
</item>
<item row="1" column="1" colspan="6">
<widget class="QFontComboBox" name="_family"/>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="_italic">
<property name="toolTip">
<string comment="italic font">Italic</string>
<string>Default Curve Color</string>
</property>
<property name="text">
<string/>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="checkable">
<bool>true</bool>
<property name="maxVisibleItems">
<number>13</number>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="Kst::ColorButton" name="_labelColor"/>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="_bold">
<property name="toolTip">
<string comment="bold font">Bold</string>
</property>
<property name="text">
<string/>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="checkable">
<bool>true</bool>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>9</height>
</size>
</property>
</widget>
</spacer>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label">
<property name="text">
<string> points</string>
</property>
</widget>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="_fontBox">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Fonts</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="_Label_11">
<property name="text">
<string>Fo&amp;nt size:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>_labelFontScale</cstring>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QDoubleSpinBox" name="_labelFontScale">
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>-25.000000000000000</double>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="_Label_12">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Font fa&amp;mily:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>_family</cstring>
</property>
</widget>
</item>
<item row="1" column="1" colspan="6">
<widget class="QFontComboBox" name="_family"/>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="_italic">
<property name="toolTip">
<string comment="italic font">Italic</string>
</property>
<property name="text">
<string/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="Kst::ColorButton" name="_labelColor"/>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="_bold">
<property name="toolTip">
<string comment="bold font">Bold</string>
</property>
<property name="text">
<string/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label">
<property name="text">
<string> points</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
Expand Down
16 changes: 3 additions & 13 deletions src/libkstmath/colorsequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@
// delivers new colors...
//

// Inrement Index: IncIndex()
// Set index: SetIndex(i)
// Index: Index()
// Current primary Color: Current(Background)
// Current Bar color: CurrentBar(Background)
// Current Head Color: CurrentHead(Background)

// Only increment if there are multiple curves in a plot.

// application specific includes
#include "colorsequence.h"
#include <QVector>
Expand Down Expand Up @@ -68,6 +59,7 @@ ColorSequence::ColorSequence() {

_count = _colors.size();
_ptr = 0;
_offset = 0;

}

Expand All @@ -77,19 +69,17 @@ ColorSequence::~ColorSequence() {

QColor ColorSequence::next() {
incIndex();
return entry(_ptr);
return entry(_ptr);
}


QColor ColorSequence::current() {
return entry(_ptr);
}



QColor ColorSequence::entry(int i) {
// makes sure 0<=i<count.
i = abs(i)%_count;
i = abs(i+_offset)%_count;

return _colors.at(i);
}
Expand Down
6 changes: 4 additions & 2 deletions src/libkstmath/colorsequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ class KSTMATH_EXPORT ColorSequence : public NextColor
public:
QColor next(); // increment and return next color
QColor current(); // current entry

QColor entry(int ptr);

void incIndex() { _ptr++; _ptr %= _count;};
void setIndex(int ptr) {_ptr = abs(ptr)%_count;};

int index() {return _ptr;};

void setOffset(int offset) {_offset = offset;};
int offset() { return _offset;};

int count() {return _count;};

static ColorSequence& self();
Expand All @@ -57,6 +58,7 @@ class KSTMATH_EXPORT ColorSequence : public NextColor

int _ptr; // pointer to the next color
int _count;
int _offset;
};

}
Expand Down