Skip to content

Commit

Permalink
Add support for box shadows with the partial renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
tronical committed Jan 24, 2025
1 parent 7ba4427 commit 88f9bdd
Show file tree
Hide file tree
Showing 22 changed files with 435 additions and 83 deletions.
8 changes: 8 additions & 0 deletions internal/backends/qt/qt_widgets/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,14 @@ impl Item for NativeButton {
qApp->style()->drawControl(QStyle::CE_PushButton, &option, painter->get(), widget);
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeButton {
Expand Down
8 changes: 8 additions & 0 deletions internal/backends/qt/qt_widgets/checkbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ impl Item for NativeCheckBox {
qApp->style()->drawControl(QStyle::CE_CheckBox, &option, painter->get(), widget);
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeCheckBox {
Expand Down
16 changes: 16 additions & 0 deletions internal/backends/qt/qt_widgets/combobox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ impl Item for NativeComboBox {
qApp->style()->drawControl(QStyle::CE_ComboBoxLabel, &option, painter->get(), widget);
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeComboBox {
Expand Down Expand Up @@ -250,6 +258,14 @@ impl Item for NativeComboBoxPopup {
style->drawControl(QStyle::CE_ShapedFrame, &option, painter->get(), widget);
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeComboBoxPopup {
Expand Down
8 changes: 8 additions & 0 deletions internal/backends/qt/qt_widgets/groupbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ impl Item for NativeGroupBox {
qApp->style()->drawComplexControl(QStyle::CC_GroupBox, &option, painter->get(), widget);
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeGroupBox {
Expand Down
8 changes: 8 additions & 0 deletions internal/backends/qt/qt_widgets/lineedit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ impl Item for NativeLineEdit {
qApp->style()->drawPrimitive(QStyle::PE_PanelLineEdit, &option, painter->get(), widget);
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeLineEdit {
Expand Down
8 changes: 8 additions & 0 deletions internal/backends/qt/qt_widgets/listviewitem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ impl Item for NativeStandardListViewItem {
}
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeStandardListViewItem {
Expand Down
8 changes: 8 additions & 0 deletions internal/backends/qt/qt_widgets/progress_indicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ impl Item for NativeProgressIndicator {
qApp->style()->drawControl(QStyle::CE_ProgressBar, &option, painter_, widget);
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeProgressIndicator {
Expand Down
8 changes: 8 additions & 0 deletions internal/backends/qt/qt_widgets/scrollview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,14 @@ impl Item for NativeScrollView {
);
}
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeScrollView {
Expand Down
8 changes: 8 additions & 0 deletions internal/backends/qt/qt_widgets/slider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,14 @@ impl Item for NativeSlider {
style->drawComplexControl(QStyle::CC_Slider, &option, painter->get(), widget);
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl NativeSlider {
Expand Down
8 changes: 8 additions & 0 deletions internal/backends/qt/qt_widgets/spinbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,14 @@ impl Item for NativeSpinBox {
(*painter)->drawText(text_rect, QString::number(value), QTextOption(static_cast<Qt::AlignmentFlag>(horizontal_alignment)));
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeSpinBox {
Expand Down
8 changes: 8 additions & 0 deletions internal/backends/qt/qt_widgets/tableheadersection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ impl Item for NativeTableHeaderSection {
#endif
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeTableHeaderSection {
Expand Down
16 changes: 16 additions & 0 deletions internal/backends/qt/qt_widgets/tabwidget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,14 @@ impl Item for NativeTabWidget {
style->drawPrimitive(QStyle::PE_FrameTabBarBase, &optTabBase, painter->get(), widget);*/
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeTabWidget {
Expand Down Expand Up @@ -528,6 +536,14 @@ impl Item for NativeTab {
qApp->style()->drawControl(QStyle::CE_TabBarTab, &option, painter->get(), widget);
});
}

fn bounding_rect_for_geometry(
self: core::pin::Pin<&Self>,
_self_rc: &ItemRc,
geometry: LogicalRect,
) -> LogicalRect {
geometry
}
}

impl ItemConsts for NativeTab {
Expand Down
Loading

0 comments on commit 88f9bdd

Please sign in to comment.