Skip to content

Commit ae7b0f8

Browse files
committed
Fixed being unable to resize tools.
1 parent 5346362 commit ae7b0f8

File tree

1 file changed

+7
-0
lines changed
  • rpfm_ui_common/src/utils

1 file changed

+7
-0
lines changed

rpfm_ui_common/src/utils/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Module with all the utility functions, to make our programming lives easier.
1414

1515
use qt_widgets::QGridLayout;
1616
use qt_widgets::QStatusBar;
17+
use qt_widgets::QVBoxLayout;
1718
use qt_widgets::{QMessageBox, q_message_box::{Icon, StandardButton}};
1819
use qt_widgets::QWidget;
1920

@@ -154,8 +155,14 @@ pub unsafe fn load_template(parent: impl CastInto<Ptr<QWidget>>, path: &str) ->
154155
let mut file = BufReader::new(File::open(path)?);
155156
file.read_to_end(&mut data)?;
156157

158+
let parent: Ptr<QWidget> = parent.cast_into();
159+
let layout = QVBoxLayout::new_1a(parent.clone());
160+
parent.set_layout(&layout);
161+
157162
let ui_loader = QUiLoader::new_0a();
158163
let main_widget = ui_loader.load_bytes_with_parent(&data, parent);
159164

165+
layout.add_widget(&main_widget);
166+
160167
Ok(main_widget)
161168
}

0 commit comments

Comments
 (0)