Skip to content

Commit

Permalink
Enable 'Shared Text' visualisation channel
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Nov 14, 2023
1 parent 50c68f6 commit e82ffa7
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/app/graph/graphmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

#include "ui/visualisations/colorvisualisationchannel.h"
#include "ui/visualisations/sizevisualisationchannel.h"
#include "ui/visualisations/sharedtextvisualisationchannel.h"
#include "ui/visualisations/textvisualisationchannel.h"
#include "ui/visualisations/textcolorvisualisationchannel.h"
#include "ui/visualisations/textsizevisualisationchannel.h"
Expand Down Expand Up @@ -368,6 +369,7 @@ GraphModel::GraphModel(const QString& name, IPlugin* plugin) :

_->_visualisationChannels.emplace(tr("Colour"), std::make_unique<ColorVisualisationChannel>());
_->_visualisationChannels.emplace(tr("Size"), std::make_unique<SizeVisualisationChannel>());
_->_visualisationChannels.emplace(tr("Shared Text"), std::make_unique<SharedTextVisualisationChannel>());
_->_visualisationChannels.emplace(tr("Text"), std::make_unique<TextVisualisationChannel>());
_->_visualisationChannels.emplace(tr("Text Colour"), std::make_unique<TextColorVisualisationChannel>());
_->_visualisationChannels.emplace(tr("Text Size"), std::make_unique<TextSizeVisualisationChannel>());
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions source/app/icon-themes/icons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@
<file>Tango/16x16/actions/process-stop.png</file>
<file>Tango/22x22/actions/process-stop.png</file>
<file>Tango/32x32/actions/process-stop.png</file>
<file>Tango/16x16/graphia/shared-text.png</file>
<file>Tango/22x22/graphia/shared-text.png</file>
<file>Tango/32x32/graphia/shared-text.png</file>
<file>Tango/16x16/graphia/show-outliers.png</file>
<file>Tango/22x22/graphia/show-outliers.png</file>
<file>Tango/32x32/graphia/show-outliers.png</file>
Expand Down
11 changes: 11 additions & 0 deletions source/app/ui/qml/Visualisation/CreateVisualisationDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@ Window
iconName: "format-text-bold"
}

NamedIcon
{
id: sharedTextIcon
width: channelIndicator._elementSize
height: channelIndicator._elementSize

iconName: "shared-text"
}

Item { Layout.fillWidth: !gradientKey.visible && !paletteKey.visible }

function update()
Expand All @@ -323,6 +332,7 @@ Window

let colourSelected = channelList.selectedValues.indexOf(qsTr("Colour")) >= 0;
let sizeSelected = channelList.selectedValues.indexOf(qsTr("Size")) >= 0;
let sharedTextSelected = channelList.selectedValues.indexOf(qsTr("Shared Text")) >= 0;
let textSelected = channelList.selectedValues.indexOf(qsTr("Text")) >= 0;
let textColourSelected = channelList.selectedValues.indexOf(qsTr("Text Colour")) >= 0;
let textSizeSelected = channelList.selectedValues.indexOf(qsTr("Text Size")) >= 0;
Expand All @@ -341,6 +351,7 @@ Window
edgeSizeIcon.visible = (attribute.elementType === ElementType.Edge);
}

sharedTextIcon.visible = sharedTextSelected;
textIcon.visible = textSelected;
textColorIcon.visible = textColourSelected;
textSizeIcon.visible = textSizeSelected;
Expand Down
3 changes: 3 additions & 0 deletions source/app/ui/qml/Visualisation/Visualisation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ Item
if(!root._valid || channel.length === 0)
return "applications-other";

if(channel === "Shared Text")
return "shared-text";

if(channel === "Text")
return "format-text-bold";

Expand Down

0 comments on commit e82ffa7

Please sign in to comment.