|
@@ -108,8 +108,8 @@ void OBSPropertiesView::ReloadProperties()
|
|
|
|
|
|
void OBSPropertiesView::RefreshProperties()
|
|
void OBSPropertiesView::RefreshProperties()
|
|
{
|
|
{
|
|
- int h, v;
|
|
|
|
- GetScrollPos(h, v);
|
|
|
|
|
|
+ int h, v, hend, vend;
|
|
|
|
+ GetScrollPos(h, v, hend, vend);
|
|
|
|
|
|
children.clear();
|
|
children.clear();
|
|
if (widget)
|
|
if (widget)
|
|
@@ -136,9 +136,9 @@ void OBSPropertiesView::RefreshProperties()
|
|
|
|
|
|
setWidgetResizable(true);
|
|
setWidgetResizable(true);
|
|
setWidget(widget);
|
|
setWidget(widget);
|
|
- SetScrollPos(h, v);
|
|
|
|
setSizePolicy(mainPolicy);
|
|
setSizePolicy(mainPolicy);
|
|
adjustSize();
|
|
adjustSize();
|
|
|
|
+ SetScrollPos(h, v, hend, vend);
|
|
|
|
|
|
lastFocused.clear();
|
|
lastFocused.clear();
|
|
if (lastWidget) {
|
|
if (lastWidget) {
|
|
@@ -154,28 +154,36 @@ void OBSPropertiesView::RefreshProperties()
|
|
emit PropertiesRefreshed();
|
|
emit PropertiesRefreshed();
|
|
}
|
|
}
|
|
|
|
|
|
-void OBSPropertiesView::SetScrollPos(int h, int v)
|
|
|
|
|
|
+void OBSPropertiesView::SetScrollPos(int h, int v, int old_hend, int old_vend)
|
|
{
|
|
{
|
|
QScrollBar *scroll = horizontalScrollBar();
|
|
QScrollBar *scroll = horizontalScrollBar();
|
|
- if (scroll)
|
|
|
|
- scroll->setValue(h);
|
|
|
|
|
|
+ if (scroll) {
|
|
|
|
+ int hend = scroll->maximum() + scroll->pageStep();
|
|
|
|
+ scroll->setValue(h * hend / old_hend);
|
|
|
|
+ }
|
|
|
|
|
|
scroll = verticalScrollBar();
|
|
scroll = verticalScrollBar();
|
|
- if (scroll)
|
|
|
|
- scroll->setValue(v);
|
|
|
|
|
|
+ if (scroll) {
|
|
|
|
+ int vend = scroll->maximum() + scroll->pageStep();
|
|
|
|
+ scroll->setValue(v * vend / old_vend);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
-void OBSPropertiesView::GetScrollPos(int &h, int &v)
|
|
|
|
|
|
+void OBSPropertiesView::GetScrollPos(int &h, int &v, int &hend, int &vend)
|
|
{
|
|
{
|
|
h = v = 0;
|
|
h = v = 0;
|
|
|
|
|
|
QScrollBar *scroll = horizontalScrollBar();
|
|
QScrollBar *scroll = horizontalScrollBar();
|
|
- if (scroll)
|
|
|
|
|
|
+ if (scroll) {
|
|
h = scroll->value();
|
|
h = scroll->value();
|
|
|
|
+ hend = scroll->maximum() + scroll->pageStep();
|
|
|
|
+ }
|
|
|
|
|
|
scroll = verticalScrollBar();
|
|
scroll = verticalScrollBar();
|
|
- if (scroll)
|
|
|
|
|
|
+ if (scroll) {
|
|
v = scroll->value();
|
|
v = scroll->value();
|
|
|
|
+ vend = scroll->maximum() + scroll->pageStep();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
OBSPropertiesView::OBSPropertiesView(OBSData settings_, obs_object_t *obj,
|
|
OBSPropertiesView::OBSPropertiesView(OBSData settings_, obs_object_t *obj,
|