Skip to content

Commit 72be8e7

Browse files
test
1 parent fbf69d9 commit 72be8e7

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

src/notation/inotationconfiguration.h

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ class INotationConfiguration : MODULE_EXPORT_INTERFACE
7777
virtual QColor loopMarkerColor() const = 0;
7878
virtual int cursorOpacity() const = 0;
7979

80+
virtual float cursorFactor() const = 0;
81+
8082
virtual bool thinNoteInputCursor() const = 0;
8183

8284
virtual QColor selectionColor(engraving::voice_idx_t voiceIndex = 0) const = 0;

src/notation/internal/notationconfiguration.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ static const Settings::Key PERCUSSION_PANEL_MOVE_MIDI_NOTES_AND_SHORTCUTS(module
114114

115115
static const Settings::Key STYLE_FILE_IMPORT_PATH_KEY(module_name, "import/style/styleFile");
116116

117+
static const Settings::Key CURSOR_FACTOR(module_name, "score/cursorFactor");
118+
117119
static constexpr int DEFAULT_GRID_SIZE_SPATIUM = 2;
118120

119121
static const std::string BY_NOTE_NAME_INPUT_METHOD("BY_NOTE_NAME");
@@ -160,6 +162,8 @@ void NotationConfiguration::init()
160162
m_backgroundChanged.notify();
161163
});
162164

165+
settings()->setDefaultValue(CURSOR_FACTOR, Val(0.7));
166+
163167
settings()->setDefaultValue(BACKGROUND_WALLPAPER_PATH, Val());
164168
settings()->valueChanged(BACKGROUND_WALLPAPER_PATH).onReceive(nullptr, [this](const Val&) {
165169
m_backgroundChanged.notify();
@@ -674,6 +678,11 @@ int NotationConfiguration::fontSize() const
674678
return uiConfiguration()->fontSize(FontSizeType::BODY);
675679
}
676680

681+
float NotationConfiguration::cursorFactor() const
682+
{
683+
return settings()->value(CURSOR_FACTOR).toFloat();
684+
}
685+
677686
muse::io::path_t NotationConfiguration::userStylesPath() const
678687
{
679688
return settings()->value(USER_STYLES_PATH).toPath();

src/notation/internal/notationconfiguration.h

+2
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ class NotationConfiguration : public INotationConfiguration, public muse::async:
117117
std::string fontFamily() const override;
118118
int fontSize() const override;
119119

120+
float cursorFactor() const override;
121+
120122
muse::io::path_t userStylesPath() const override;
121123
void setUserStylesPath(const muse::io::path_t& path) override;
122124
muse::async::Channel<muse::io::path_t> userStylesPathChanged() const override;

src/notation/view/notationruler.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ void NotationRuler::paintLine(Painter* painter, LineType type, const PointF& poi
157157

158158
if (type == LineType::CurrentPosition) {
159159
Font font(uiConfiguration()->iconsFontFamily(), Font::Type::Icon);
160-
font.setPointSizeF(rect.height() * 0.7);
160+
font.setPixelSize(rect.height() * configuration()->cursorFactor());
161+
162+
double scaling = uiConfiguration()->guiScaling();
163+
LOGE() << "Rect height: " << rect.height() << ", rect y: " << rect.y() << ", font size: " << font.pixelSize()
164+
<< ", spatium: " << spatium << ", ui scaling: " << scaling << ", factor: " << configuration()->cursorFactor();
161165

162166
painter->setPen(color);
163167
painter->setFont(font);

0 commit comments

Comments
 (0)