Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 7 additions & 5 deletions src/palette/widgets/customizekitdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ CustomizeKitDialog::CustomizeKitDialog(QWidget* parent)
drumNote->setDrawGrid(false);
drumNote->setReadOnly(true);

QTreeWidgetItem* itemToSelect = loadPitchesList();

for (auto g : noteHeadNames) {
noteHead->addItem(TConv::translatedUserName(g), int(g));
}
Expand Down Expand Up @@ -259,9 +257,6 @@ CustomizeKitDialog::CustomizeKitDialog(QWidget* parent)
connect(customGbox, &QGroupBox::toggled, this, &CustomizeKitDialog::customGboxToggled);
connect(quarterCmb, &QComboBox::currentIndexChanged, this, &CustomizeKitDialog::customQuarterChanged);

Q_ASSERT(pitchList->topLevelItemCount() > 0);
pitchList->setCurrentItem(itemToSelect ? itemToSelect : pitchList->topLevelItem(0));

quarterCmb->setAccessibleName(quarterLbl->text() + " " + quarterCmb->currentText());
halfCmb->setAccessibleName(halfLbl->text() + " " + halfCmb->currentText());
wholeCmb->setAccessibleName(wholeLbl->text() + " " + wholeCmb->currentText());
Expand All @@ -279,6 +274,13 @@ void CustomizeKitDialog::componentComplete()
}

initDrumsetAndKey();

QTreeWidgetItem* itemToSelect = loadPitchesList();
itemToSelect = itemToSelect ? itemToSelect : pitchList->topLevelItem(0);

if (itemToSelect) {
pitchList->setCurrentItem(itemToSelect);
}
}

//---------------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions src/palette/widgets/noteGroups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ NoteGroups::NoteGroups(QWidget* parent)
: QGroupBox(parent), muse::Contextable(muse::iocCtxForQWidget(this))
{
setupUi(this);
}

void NoteGroups::classBegin()
{
iconPalette->classBegin();

iconPalette->setName(QT_TRANSLATE_NOOP("palette", "Beam selector"));
iconPalette->setGridSize(27, 40);
Expand Down Expand Up @@ -109,6 +114,11 @@ NoteGroups::NoteGroups(QWidget* parent)
connect(view32, &NoteGroupsExampleView::beamPropertyDropped, this, &NoteGroups::beamPropertyDropped);
}

void NoteGroups::componentComplete()
{
iconPalette->componentComplete();
}

void NoteGroups::setSig(Fraction sig, const Groups& g, const QString& z, const QString& n)
{
_sig = sig;
Expand Down
4 changes: 4 additions & 0 deletions src/palette/widgets/noteGroups.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ private slots:

public:
NoteGroups(QWidget* parent);

void classBegin();
void componentComplete();

void setSig(engraving::Fraction sig, const engraving::Groups&, const QString& zText, const QString& nText);
engraving::Groups groups();
};
Expand Down
13 changes: 12 additions & 1 deletion src/palette/widgets/palettewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ using namespace muse::actions;
PaletteWidget::PaletteWidget(QWidget* parent)
: QWidget(parent), muse::Contextable(muse::iocCtxForQWidget(this))
{
m_palette = std::make_shared<Palette>(iocContext());
//! NOTE: set ioc ctx later
m_palette = std::make_shared<Palette>(nullptr);

//! NOTE: need for accessibility
m_palette->setParent(this);
Expand All @@ -88,6 +89,16 @@ PaletteWidget::PaletteWidget(QWidget* parent)
setMouseTracking(true);
}

void PaletteWidget::classBegin()
{
m_palette->setContext(iocContext());
}

void PaletteWidget::componentComplete()
{
// noop
}

void PaletteWidget::setPalette(PalettePtr palette)
{
if (!palette) {
Expand Down
3 changes: 3 additions & 0 deletions src/palette/widgets/palettewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ class PaletteWidget : public QWidget, public muse::async::Asyncable, public muse
const PaintOptions& paintOptions() const;
void setPaintOptions(const PaintOptions& options);

void classBegin();
void componentComplete();

signals:
void changed();
void boxClicked(int index);
Expand Down
9 changes: 8 additions & 1 deletion src/palette/widgets/timesignaturepropertiesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ TimeSignaturePropertiesDialog::~TimeSignaturePropertiesDialog()
delete m_editedTimeSig;
}

void TimeSignaturePropertiesDialog::componentComplete()
void TimeSignaturePropertiesDialog::classBegin()
{
groups->classBegin();

QString musicalFontFamily = QString::fromStdString(uiConfiguration()->musicalFontFamily());
int musicalFontSize = uiConfiguration()->musicalFontSize();

Expand Down Expand Up @@ -165,6 +167,11 @@ void TimeSignaturePropertiesDialog::componentComplete()
groups->setSig(m_editedTimeSig->sig(), g, m_editedTimeSig->numeratorString(), m_editedTimeSig->denominatorString());
}

void TimeSignaturePropertiesDialog::componentComplete()
{
groups->componentComplete();
}

void TimeSignaturePropertiesDialog::showEvent(QShowEvent* event)
{
WidgetStateStore::restoreGeometry(this);
Expand Down
1 change: 1 addition & 0 deletions src/palette/widgets/timesignaturepropertiesdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class TimeSignaturePropertiesDialog : public muse::ui::WidgetDialog, public Ui::
TimeSignaturePropertiesDialog(QWidget* parent = nullptr);
~TimeSignaturePropertiesDialog() override;

void classBegin() override;
void componentComplete() override;

private slots:
Expand Down
Loading