Text formatting for vulkan feature list

This commit is contained in:
Ilya Zlobintsev 2020-11-15 09:23:24 +02:00
parent bcbb87e74c
commit b94dd2c265
2 changed files with 13 additions and 3 deletions

View File

@ -346,9 +346,11 @@ fn set_info(builder: &Builder, gpu_info: &GpuInfo) {
&gpu_info.link_speed, &gpu_info.link_width
));
let vulkan_features = gpu_info.vulkan_info.features.replace(',', "\n").replace("Features", "").replace("{", "").replace("}", "").replace(" ", "").replace(":", ": ");
vulkan_device_name_text_buffer.set_text(&gpu_info.vulkan_info.device_name);
vulkan_version_text_buffer.set_text(&gpu_info.vulkan_info.api_version);
vulkan_features_text_buffer.set_text(&gpu_info.vulkan_info.features);
vulkan_features_text_buffer.set_text(&vulkan_features);
power_cap_label.set_text(&format!("{}/{}", gpu_info.power_cap, gpu_info.power_cap_max));
gpu_power_adjustment.set_upper(gpu_info.power_cap_max as f64);

View File

@ -94,17 +94,20 @@
<object class="GtkWindow" id="main_window">
<property name="can-focus">False</property>
<property name="title" translatable="yes">LACT</property>
<property name="default-width">350</property>
<property name="default-height">500</property>
<property name="default-width">450</property>
<property name="default-height">600</property>
<child>
<object class="GtkNotebook">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<!-- n-columns=2 n-rows=7 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
@ -329,6 +332,7 @@
<property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="hexpand">True</property>
<property name="label-xalign">0.5</property>
<property name="shadow-type">none</property>
<child>
@ -337,6 +341,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">center</property>
<property name="hexpand">True</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
@ -408,12 +413,15 @@
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="shadow-type">in</property>
<property name="propagate-natural-height">True</property>
<child>
<object class="GtkTextView">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="editable">False</property>
<property name="wrap-mode">word</property>
<property name="buffer">vulkan_features_text_buffer</property>
</object>