Changeset View
Changeset View
Standalone View
Standalone View
kstars/indi/indiproperty.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | 90 | { | |||
---|---|---|---|---|---|
95 | 95 | | |||
96 | /* add to GUI group */ | 96 | /* add to GUI group */ | ||
97 | ledStatus.reset(new KLed(pg->getContainer())); | 97 | ledStatus.reset(new KLed(pg->getContainer())); | ||
98 | ledStatus->setMaximumSize(16, 16); | 98 | ledStatus->setMaximumSize(16, 16); | ||
99 | ledStatus->setLook(KLed::Sunken); | 99 | ledStatus->setLook(KLed::Sunken); | ||
100 | 100 | | |||
101 | updateStateLED(); | 101 | updateStateLED(); | ||
102 | 102 | | |||
103 | /* Create a horizontally layout widget around light and label */ | ||||
104 | QWidget *labelWidget = new QWidget(); | ||||
105 | QHBoxLayout *labelLayout = new QHBoxLayout(); | ||||
106 | labelLayout->setContentsMargins(0, 0, 0, 0); | ||||
107 | labelWidget->setLayout(labelLayout); | ||||
108 | | ||||
103 | /* #1 First widget is the LED status indicator */ | 109 | /* #1 First widget is the LED status indicator */ | ||
104 | PHBox->addWidget(ledStatus.get()); | 110 | labelLayout->addWidget(ledStatus.get()); | ||
105 | 111 | | |||
106 | if (label.isEmpty()) | 112 | if (label.isEmpty()) | ||
107 | { | 113 | { | ||
108 | label = i18nc(libindi_strings_context, name.toUtf8()); | 114 | label = i18nc(libindi_strings_context, name.toUtf8()); | ||
109 | if (label == "(I18N_EMPTY_MESSAGE)") | 115 | if (label == "(I18N_EMPTY_MESSAGE)") | ||
110 | label = name.toUtf8(); | 116 | label = name.toUtf8(); | ||
111 | 117 | | |||
112 | labelW.reset(new KSqueezedTextLabel(label, pg->getContainer())); | 118 | labelW.reset(new KSqueezedTextLabel(label, pg->getContainer())); | ||
113 | } | 119 | } | ||
114 | else | 120 | else | ||
115 | labelW.reset(new KSqueezedTextLabel(label, pg->getContainer())); | 121 | labelW.reset(new KSqueezedTextLabel(label, pg->getContainer())); | ||
116 | 122 | | |||
117 | //labelW->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); | 123 | //labelW->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); | ||
118 | labelW->setFrameShape(QFrame::StyledPanel); | 124 | labelW->setFrameShape(QFrame::Box); | ||
125 | labelW->setFrameShadow(QFrame::Sunken); | ||||
126 | labelW->setMargin(2); | ||||
119 | labelW->setFixedWidth(PROPERTY_LABEL_WIDTH * KStars::Instance()->devicePixelRatio()); | 127 | labelW->setFixedWidth(PROPERTY_LABEL_WIDTH * KStars::Instance()->devicePixelRatio()); | ||
120 | labelW->setTextFormat(Qt::RichText); | 128 | labelW->setTextFormat(Qt::RichText); | ||
121 | labelW->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); | 129 | labelW->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); | ||
122 | labelW->setWordWrap(true); | 130 | labelW->setWordWrap(true); | ||
123 | 131 | | |||
124 | PHBox->addWidget(labelW.get()); | 132 | labelLayout->addWidget(labelW.get()); | ||
133 | PHBox->addWidget(labelWidget, 0, Qt::AlignTop | Qt::AlignLeft); | ||||
125 | 134 | | |||
126 | ledStatus->show(); | 135 | ledStatus->show(); | ||
127 | labelW->show(); | 136 | labelW->show(); | ||
128 | 137 | | |||
129 | // #3 Add the Vertical layout which may contain several elements | 138 | // #3 Add the Vertical layout which may contain several elements | ||
130 | PHBox->addLayout(PVBox); | 139 | PHBox->addLayout(PVBox); | ||
131 | 140 | | |||
132 | switch (dataProp->getType()) | 141 | switch (dataProp->getType()) | ||
▲ Show 20 Lines • Show All 542 Lines • Show Last 20 Lines |