Skip to content

Commit

Permalink
Adjustments in SceneInfoWidget layout to avoid components wobbling when
Browse files Browse the repository at this point in the history
moving objects (WIP)
  • Loading branch information
rkhaotix committed Apr 16, 2024
1 parent ad86301 commit ebd1724
Show file tree
Hide file tree
Showing 5 changed files with 398 additions and 277 deletions.
8 changes: 7 additions & 1 deletion assets/conf/themes/inksaver/extra-ui-style.conf
Expand Up @@ -150,4 +150,10 @@ QSplitter::handle:vertical {
image: url(':/images/images/vsplitter_handle_light.png');
height: 4px;
margin: 1px;
}
}

SceneInfoWidget > QFrame {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #c3c4c5 stop: 0.001 #dedfe0, stop: 1 #dedfe0);
border-radius: 4px;
border: 1px solid #ababac;
}
8 changes: 7 additions & 1 deletion assets/conf/themes/light/extra-ui-style.conf
Expand Up @@ -150,4 +150,10 @@ QSplitter::handle:vertical {
image: url(':/images/images/vsplitter_handle_light.png');
height: 4px;
margin: 1px;
}
}

SceneInfoWidget > QFrame {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #c3c4c5 stop: 0.001 #dedfe0, stop: 1 #dedfe0);
border-radius: 4px;
border: 1px solid #ababac;
}
8 changes: 7 additions & 1 deletion assets/conf/ui-style.conf
Expand Up @@ -351,4 +351,10 @@ QSplitter::handle:vertical {
image: url(':/images/images/vsplitter_handle_dark.png');
height: 4px;
margin: 1px;
}
}

SceneInfoWidget > QFrame {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(base) stop: 0.01 palette(mid), stop: 1 palette(mid));
border-radius: 4px;
border: 1px solid palette(midlight);
}
14 changes: 7 additions & 7 deletions libs/libgui/src/widgets/sceneinfowidget.cpp
Expand Up @@ -29,9 +29,9 @@ void SceneInfoWidget::updateSelectedObject(BaseObjectView *object)
{
if(!object)
{
obj_icon_lbl->setPixmap(QPixmap(GuiUtilsNs::getIconPath("close1")));
obj_name_lbl->setText(tr("No selection"));
obj_pos_info_lbl->setText(tr("N/A"));
sel_obj_icon_lbl->setPixmap(QPixmap(GuiUtilsNs::getIconPath("close1")));
sel_obj_count_lbl->setText(tr("None"));
obj_pos_info_lbl->setText(tr("None"));
}
else
{
Expand All @@ -42,8 +42,8 @@ void SceneInfoWidget::updateSelectedObject(BaseObjectView *object)
object->boundingRect().width(),
object->boundingRect().height());

obj_icon_lbl->setPixmap(GuiUtilsNs::getIconPath(object->getUnderlyingObject()->getSchemaName()));
obj_name_lbl->setText(QString("<strong>%1</strong> <em>(%2)</em>").arg(object->getUnderlyingObject()->getSignature()).arg(object->getUnderlyingObject()->getTypeName()));
sel_obj_icon_lbl->setPixmap(GuiUtilsNs::getIconPath(object->getUnderlyingObject()->getSchemaName()));
sel_obj_count_lbl->setText(tr("Selected: <strong>%1</strong>").arg(1));
obj_pos_info_lbl->setText(QString("(%1, %2) [w: %3, h: %4]")
.arg(round(rect.left()))
.arg(round(rect.top()))
Expand All @@ -59,8 +59,8 @@ void SceneInfoWidget::updateSelectedObjects(int obj_count, const QRectF &objs_re
if(!rect.isValid())
rect = QRect(0,0,0,0);

obj_icon_lbl->setPixmap(QPixmap(GuiUtilsNs::getIconPath("selectall")));
obj_name_lbl->setText(tr("Sel. objects: %1").arg(obj_count));
sel_obj_icon_lbl->setPixmap(QPixmap(GuiUtilsNs::getIconPath("selectmove")));
sel_obj_count_lbl->setText(tr("Selected: <strong>%1</strong>").arg(obj_count));
obj_pos_info_lbl->setText(QString("(%1, %2) [w: %3, h: %4]")
.arg(rect.left())
.arg(rect.top())
Expand Down

0 comments on commit ebd1724

Please sign in to comment.