Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Desktop/components/JASP/Theme/Theme.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ JaspTheme
fontGroupTitle.pixelSize: Math.round(14 * uiScale)
fontGroupTitle.family: preferencesModel.interfaceFont
fontGroupTitle.weight: Font.Medium

fontGroupTitleSmall.bold: true
fontGroupTitleSmall.pixelSize: Math.round(12 * uiScale)
fontGroupTitleSmall.family: preferencesModel.interfaceFont
fontGroupTitleSmall.weight: Font.Medium

fontALTNavTag.bold: true
fontALTNavTag.pixelSize: Math.round(15 * uiScale)
Expand Down
5 changes: 3 additions & 2 deletions Desktop/components/JASP/Widgets/CustomMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ FocusScope
{
id : menuItem
width : initWidth
height : (isSmall ? 0.5 : 1) * jaspTheme.menuGroupTitleHeight
height : (isSmall ? 0.666 : 1) * jaspTheme.menuGroupTitleHeight

property double initWidth: menuItemImage.width + menuItemText.implicitWidth + 15 * preferencesModel.uiScale

Expand Down Expand Up @@ -410,8 +410,9 @@ FocusScope
{
id : menuItemText
text : model.modelData !== undefined ? model.modelData.substring(3) : displayText
font : jaspTheme.fontGroupTitle
font : isSmall ? jaspTheme.fontGroupTitleSmall : jaspTheme.fontGroupTitle
color : jaspTheme.textEnabled
verticalAlignment : Text.AlignVCenter
anchors
{
left : menuItemImage.right
Expand Down
8 changes: 5 additions & 3 deletions Desktop/modules/description/entrybase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ QString EntryBase::toString() const
{
switch(_entryType)
{
case EntryType::separator: return "-- separator --";
case EntryType::groupTitle: return "-- groupTitle '" + title() + "' icon: '" + icon() + "' --";
case EntryType::separator: return "-- separator --";
case EntryType::groupTitle: return "-- groupTitle '" + title() + "' icon: '" + icon() + "' --";
case EntryType::groupTitleSmall: return "-- groupTitleSmall '" + title() + "' icon: '" + icon() + "' --";
case EntryType::analysis:
return "-- analysis '" + title()
+ ( menu() != title() ? " menu: '" + menu() + "'" : "" )
Expand Down Expand Up @@ -174,7 +175,8 @@ AnalysisEntry * EntryBase::convertToAnalysisEntry(bool requiresDataDefault, bool
entry->_isEnabled = _enabled;
entry->_isAnalysis = _entryType == EntryType::analysis;
entry->_isSeparator = _entryType == EntryType::separator;
entry->_isGroupTitle = _entryType == EntryType::groupTitle;
entry->_isGroupTitle = _entryType == EntryType::groupTitle || _entryType == EntryType::groupTitleSmall;
entry->_smallIcon = _entryType == EntryType::groupTitleSmall;
entry->_hasWrapper = _description->hasWrappers() || _hasWrapper;
entry->_dynamicModule = _description->dynMod();

Expand Down
9 changes: 5 additions & 4 deletions Desktop/modules/description/entrybase.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class EntryBase : public DescriptionChildBase
Q_PROPERTY(bool hasWrapper READ hasWrapper WRITE setHasWrapper NOTIFY hasWrapperChanged )

public:
enum class EntryType {unknown, separator, groupTitle, analysis};
enum class EntryType {unknown, separator, groupTitle, groupTitleSmall, analysis};
Q_ENUM(EntryType);

EntryBase(EntryType entryType);
Expand Down Expand Up @@ -108,8 +108,9 @@ public: \
{}\
}

MAKE_ENTRY_CLASS(Separator, separator);
MAKE_ENTRY_CLASS(AnalysisItem, analysis);
MAKE_ENTRY_CLASS(GroupTitle, groupTitle);
MAKE_ENTRY_CLASS(Separator, separator);
MAKE_ENTRY_CLASS(AnalysisItem, analysis);
MAKE_ENTRY_CLASS(GroupTitle, groupTitle);
MAKE_ENTRY_CLASS(GroupTitleSmall, groupTitleSmall);
}
#endif // ENTRYBASE_H
1 change: 1 addition & 0 deletions Desktop/modules/dynamicmodules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ void DynamicModules::registerQMLTypes()
qmlRegisterType<Modules::AnalysisItem> ("JASP.Module", 1, 0, "Analysis" );
qmlRegisterType<Modules::Separator> ("JASP.Module", 1, 0, "Separator" );
qmlRegisterType<Modules::GroupTitle> ("JASP.Module", 1, 0, "GroupTitle" );
qmlRegisterType<Modules::GroupTitleSmall> ("JASP.Module", 1, 0, "GroupTitleSmall" );
qmlRegisterType<Modules::Upgrades> ("JASP.Module", 1, 0, "Upgrades" );
qmlRegisterType<Modules::Upgrade> ("JASP.Module", 1, 0, "Upgrade" );
qmlRegisterType<Modules::ChangeJS> ("JASP.Module", 1, 0, "ChangeJS" );
Expand Down
2 changes: 1 addition & 1 deletion Modules/jaspTestModule
13 changes: 13 additions & 0 deletions QMLComponents/jasptheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1331,3 +1331,16 @@ void JaspTheme::setColumnTypeScaleHovered(float newColumnTypeScaleHovered)
_columnTypeScaleHovered = newColumnTypeScaleHovered;
emit columnTypeScaleHoveredChanged();
}

QFont JaspTheme::fontGroupTitleSmall() const
{
return _fontGroupTitleSmall;
}

void JaspTheme::setFontGroupTitleSmall(const QFont &newFontGroupTitleSmall)
{
if (_fontGroupTitleSmall == newFontGroupTitleSmall)
return;
_fontGroupTitleSmall = newFontGroupTitleSmall;
emit fontGroupTitleSmallChanged();
}
7 changes: 7 additions & 0 deletions QMLComponents/jasptheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class JaspTheme : public QQuickItem
Q_PROPERTY(QFont fontLabel READ fontLabel WRITE setFontLabel NOTIFY fontLabelChanged )
Q_PROPERTY(QFont fontRibbon READ fontRibbon WRITE setFontRibbon NOTIFY fontRibbonChanged )
Q_PROPERTY(QFont fontGroupTitle READ fontGroupTitle WRITE setFontGroupTitle NOTIFY fontGroupTitleChanged )
Q_PROPERTY(QFont fontGroupTitleSmall READ fontGroupTitleSmall WRITE setFontGroupTitleSmall NOTIFY fontGroupTitleSmallChanged )
Q_PROPERTY(QFont fontPrefOptionsGroupTitle READ fontPrefOptionsGroupTitle WRITE setFontPrefOptionsGroupTitle NOTIFY fontPrefOptionsGroupTitleChanged )
Q_PROPERTY(QFont fontALTNavTag READ fontALTNavTag WRITE setFontALTNavTag NOTIFY fontALTNavTagChanged )

Expand Down Expand Up @@ -327,6 +328,9 @@ class JaspTheme : public QQuickItem
float columnTypeScaleHovered() const;
void setColumnTypeScaleHovered(float newColumnTypeScaleHovered);

QFont fontGroupTitleSmall() const;
void setFontGroupTitleSmall(const QFont &newFontGroupTitleSmall);

signals:
void currentThemeReady(JaspTheme * newTheme);
void uiScaleChanged(float uiScale);
Expand Down Expand Up @@ -464,6 +468,8 @@ class JaspTheme : public QQuickItem

void columnTypeScaleHoveredChanged();

void fontGroupTitleSmallChanged();

public slots:
void setRibbonScaleHovered(float ribbonScaleHovered);
void setWhite(QColor white);
Expand Down Expand Up @@ -738,6 +744,7 @@ private slots:
_fontRCode,
_fontCode,
_fontGroupTitle,
_fontGroupTitleSmall,
_fontPrefOptionsGroupTitle,
_fontALTNavTag;

Expand Down
Loading