Skip to content

Commit

Permalink
horizon ladder - scale home icon, restart qopenhd box - decrease size,
Browse files Browse the repository at this point in the history
status - slightly smaller text / ratio (OK on 480p), video / wb link rate widget style improvments neccessary due to change to ComboBox
  • Loading branch information
Consti10 committed Nov 14, 2023
1 parent 54576da commit 38b3243
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 63 deletions.
23 changes: 11 additions & 12 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ int main(int argc, char *argv[]) {
}

QSettings settings;
qDebug()<<"Storing settings at ["<<settings.fileName()<<"]";

const int screen_custom_font_dpi = settings.value("screen_custom_font_dpi").toInt();
if (screen_custom_font_dpi) {
Expand All @@ -213,22 +214,10 @@ int main(int argc, char *argv[]) {
}
//QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
//QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);

// From https://stackoverflow.com/questions/63473541/how-to-dynamically-toggle-vsync-in-a-qt-application-at-runtime
// Get rid of VSYNC if possible. Might / might not work. On my ubuntu nvidia & intel laptop, this at least seems to
// result in tripple buffering with unlimited fps, a bit "better" regarding latency than default.
if(settings.value("dev_set_swap_interval_zero",false).toBool()){
qDebug()<<"Request swap interval of 0";
QSurfaceFormat format=QSurfaceFormat::defaultFormat();
format.setSwapInterval(0);
QSurfaceFormat::setDefaultFormat(format);
}

const double global_scale = settings.value("global_scale", 1.0).toDouble();
const std::string global_scale_s = std::to_string(global_scale);
QByteArray scaleAsQByteArray(global_scale_s.c_str(), global_scale_s.length());
qputenv("QT_SCALE_FACTOR", scaleAsQByteArray);
qDebug()<<"Storing settings at ["<<settings.fileName()<<"]";

// https://doc.qt.io/qt-6/qtquick-visualcanvas-scenegraph-renderer.html
//qputenv("QSG_VISUALIZE", "overdraw");
Expand All @@ -243,6 +232,16 @@ int main(int argc, char *argv[]) {
//QLoggingCategory::setFilterRules("qt.qpa.eglfs.*=true");
//QLoggingCategory::setFilterRules("qt.qpa.egl*=true");

// From https://stackoverflow.com/questions/63473541/how-to-dynamically-toggle-vsync-in-a-qt-application-at-runtime
// Get rid of VSYNC if possible. Might / might not work. On my ubuntu nvidia & intel laptop, this at least seems to
// result in tripple buffering with unlimited fps, a bit "better" regarding latency than default.
if(settings.value("dev_set_swap_interval_zero",false).toBool()){
qDebug()<<"Request swap interval of 0";
QSurfaceFormat format=QSurfaceFormat::defaultFormat();
format.setSwapInterval(0);
QSurfaceFormat::setDefaultFormat(format);
}

QApplication app(argc, argv);
// Customize cursor if needed
QOpenHD::instance().customize_cursor_from_settings();
Expand Down
4 changes: 3 additions & 1 deletion app/osd/horizonladder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ HorizonLadder::HorizonLadder(QQuickItem *parent): QQuickPaintedItem(parent) {
setRenderTarget(RenderTarget::FramebufferObject);

//m_font.setPixelSize(14);
m_font.setPointSize(14);
m_font.setPointSize(DEFAULT_FONT_PIXEL_SIZE);
m_fontAwesome.setPointSize(DEFAULT_FONT_PIXEL_SIZE);
}

void HorizonLadder::paint(QPainter* painter) {
Expand Down Expand Up @@ -500,5 +501,6 @@ void HorizonLadder::set_custom_font_scale(double custom_font_scale)
{
m_custom_font_scale=custom_font_scale;
m_font.setPointSize(DEFAULT_FONT_PIXEL_SIZE*m_custom_font_scale);
m_fontAwesome.setPointSize(DEFAULT_FONT_PIXEL_SIZE*m_custom_font_scale);
update();
}
2 changes: 1 addition & 1 deletion app/osd/horizonladder.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public slots:

QFont m_font;

QFont m_fontAwesome = QFont("Font Awesome 5 Free", 15, QFont::Bold, false);
QFont m_fontAwesome = QFont("Font Awesome 5 Free", 11, QFont::Bold, false);
double m_custom_font_scale=1.0;
};
#endif //QOPENHD_HORIZON_LADDER
7 changes: 5 additions & 2 deletions app/util/qopenhd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ bool QOpenHD::overwrite_settings_from_backup_file()

bool QOpenHD::reset_settings()
{
#ifdef __linux__
/*#ifdef __linux__
QSettings settings;
std::string file_name = settings.fileName().toStdString();
int result = remove(file_name.c_str());
Expand All @@ -213,7 +213,10 @@ bool QOpenHD::reset_settings()
qDebug() << "Error: Failed to delete file" << QString::fromStdString(file_name);
return false;
#endif
return false;
return false;*/
QSettings settings;
settings.clear();
return true;
}


Expand Down
4 changes: 2 additions & 2 deletions app/util/qrenderstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class QRenderStats : public QObject
L_RO_PROP(QString, display_width_height_str, set_display_width_height_str, "NA")
L_RO_PROP(QString, screen_width_height_str, set_screen_width_height_str, "NA")
// Resolution qopenhd is rendering at
L_RO_PROP(int, window_width, set_window_width, -1)
L_RO_PROP(int, window_height, set_window_height, -1)
L_RW_PROP(int, window_width, set_window_width, -1)
L_RW_PROP(int, window_height, set_window_height, -1)
// Time QT spent "rendering", probably aka creating the GPU command buffer
L_RO_PROP(QString, qt_rendering_time, set_qt_rendering_time, "NA")
// Time QT spent "recording the render pass"
Expand Down
4 changes: 2 additions & 2 deletions qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ ApplicationWindow {
height: (settings.general_screen_rotation == 90 || settings.general_screen_rotation == 270) ? m_window_width : m_window_height

onWidthChanged: {
//_qrenderstats.set_window_width(width)
_qrenderstats.set_window_width(width)
}
onHeightChanged: {
//_qrenderstats.set_window_height(height)
_qrenderstats.set_window_height(height)
}

contentOrientation: settings.general_screen_rotation===0 ? Qt.PortraitOrientation : Qt.LandscapeOrientation
Expand Down
2 changes: 1 addition & 1 deletion qml/ui/configpopup/qopenhd_settings/AppDevSettingsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ ScrollView {
onClicked: {
simplePopupHack.visible=true;
}
enabled: _qopenhd.is_linux()
//enabled: _qopenhd.is_linux()
}
}
SettingBaseElement{
Expand Down
8 changes: 4 additions & 4 deletions qml/ui/configpopup/status/StatusCardRow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@ Item {

Text{
id: left_part
width: parent.width/3
width: parent.width*0.4
height: parent.height
anchors.left: parent.left
anchors.top: parent.top
text: m_left_text
verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignRight
font.bold: true
font.pixelSize: 19
font.pixelSize: 18
clip: true
}

Text{
id: right_part
width: parent.width/3*2;
width: parent.width-left_part.width
height: parent.height
anchors.left: left_part.right
anchors.top: left_part.top
Expand All @@ -92,7 +92,7 @@ Item {
horizontalAlignment: Qt.AlignCenter
color: m_has_error ? m_right_text_color_error : m_right_text_color
visible: !right_part_button.visible
font.pixelSize: 19
font.pixelSize: 18
}
MouseArea {
enabled: m_has_error && !m_look_shit_on_error
Expand Down
4 changes: 2 additions & 2 deletions qml/ui/elements/RestartQOpenHDMessageBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import OpenHD 1.0
// See corresponding .cpp for more info
Card {
id: restartqopenhdmessagebox
width: 360
height: 340
width: 320
height: 240
z: 6.0
anchors.centerIn: parent
cardName: qsTr("QOpenHD")
Expand Down
6 changes: 3 additions & 3 deletions qml/ui/elements/SmallHeaderInfoRow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.12

Item {
width: parent.width
height: 40
height: 32

property string m_text: "FILL ME"
property string m_info_text: "FILL ME"
Expand All @@ -12,8 +12,8 @@ Item {
verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignLeft
text: m_text
font.pixelSize: 18
font.bold: true
font.pixelSize: 16
//font.bold: true
color: "white"
}
ButtonIconInfo{
Expand Down
2 changes: 1 addition & 1 deletion qml/ui/widgets/VideoBitrateWidgetGeneric.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ BaseWidget {

hasWidgetDetail: true
hasWidgetAction: true
widgetActionHeight: 450
widgetActionHeight: 420

property var m_camera_stream_model: m_is_for_primary_camera ? _cameraStreamModelPrimary : _cameraStreamModelSecondary

Expand Down
87 changes: 55 additions & 32 deletions qml/ui/widgets/WBLinkRateControlWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ BaseWidget {
hasWidgetAction: true

property int m_widget_action_w: 256
property int m_widget_action_h: 300+100;
property int m_widget_action_h: 300;
widgetActionWidth: m_widget_action_w
widgetActionHeight: m_widget_action_h

Expand Down Expand Up @@ -202,7 +202,7 @@ The lower the MCS (Modulation and coding) index, the less signal (dBm) is requir
property string m_DESCRIPTION_STABILITY: "
Make the video more stable (less microfreezes) on the cost of less image quality."+
"Internally, this changes the encode keyframe interval and/ or FEC overhead in percent. DEFAULT is a good trade off regarding image quality and stability"+
"and works in most cases. Use CITY/POLLUTED on polluted channels, DESERT if you have a completely clean channel."
"and works in most cases. Use CITY/POLLUTED on polluted channels,but it is always better to find a free channel."

widgetDetailComponent: ScrollView {

Expand Down Expand Up @@ -303,46 +303,64 @@ Make the video more stable (less microfreezes) on the cost of less image quality
}

//---------------------------ACTION WIDGET COMPONENT BELOW-----------------------------
widgetActionComponent: ScrollView {

ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
clip: true
width: parent.width
height: parent.height

widgetActionComponent:
Column {
width: m_widget_action_w-32
//height: m_widget_action_h
//spacing: 20

SmallHeaderInfoRow{
m_text: "Range vs Bitrate"
m_info_text: m_DESCRIPTION_CHANNEL_WIDTH
}
Row{
width: m_widget_action_w-32
SmallHeaderInfoRow{
m_text: "Range vs Bitrate"
m_info_text: m_DESCRIPTION_CHANNEL_WIDTH
}
/*TabBar{
width: parent.width
height: m_row_height
spacing: 20
enabled: _ohdSystemAir.is_alive;
Button{
id: channel_width_tab_bar
currentIndex: m_curr_channel_width==40 ? 1 : 0;
onCurrentIndexChanged: {
//const chan_w= currentIndex==0 ? 20 : 40;
//set_channel_width_async(20)
}
TabButton{
text: "20Mhz"
onClicked: {
set_channel_width_async(20)
}
highlighted: m_curr_channel_width==20
}
Button{
TabButton{
text: "40Mhz"
onClicked: {
set_channel_width_async(40)
set_channel_width_async(40)
}
highlighted: m_curr_channel_width==40
}
}*/
Row{
width: parent.width
height: m_row_height
spacing: 20
Button{
text: "20Mhz"
onClicked: {
set_channel_width_async(20)
}
highlighted: m_curr_channel_width==20
//enabled: _ohdSystemAir.is_alive;
}
SmallHeaderInfoRow{
m_text: "Range vs Bitrate"
m_info_text: m_DESCRIPTION_MCS
Button{
text: "40Mhz"
onClicked: {
set_channel_width_async(40)
}
highlighted: m_curr_channel_width==40
//enabled: _ohdSystemAir.is_alive;
}
}
SmallHeaderInfoRow{
m_text: "Range vs Bitrate"
m_info_text: m_DESCRIPTION_MCS
}
Row{
width: parent.width
height: m_row_height

ComboBox{
width: parent.width
height: m_row_height
Expand All @@ -363,10 +381,14 @@ Make the video more stable (less microfreezes) on the cost of less image quality
}
enabled: _ohdSystemAir.is_alive;
}
SmallHeaderInfoRow{
m_text: "Stability vs Bitrate"
m_info_text:m_DESCRIPTION_STABILITY
}
}
SmallHeaderInfoRow{
m_text: "Resiliency vs Bitrate"
m_info_text:m_DESCRIPTION_STABILITY
}
Row{
width: parent.width
height: m_row_height
ComboBox{
width: parent.width
height: m_row_height
Expand All @@ -391,6 +413,7 @@ Make the video more stable (less microfreezes) on the cost of less image quality
}
}


Item {
id: widgetInner
anchors.fill: parent
Expand Down

0 comments on commit 38b3243

Please sign in to comment.