diff --git a/CMakeLists.txt b/CMakeLists.txt index 5aabcd1fd..cfd644278 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,6 +238,7 @@ set (wsjt_qt_CXXSRCS Network/NetworkAccessManager.cpp widgets/LazyFillComboBox.cpp widgets/CheckableItemComboBox.cpp + widgets/BandComboBox.cpp ) set (wsjt_qtmm_CXXSRCS diff --git a/map65/mainwindow.ui b/map65/mainwindow.ui index 29aac7e39..c52295a93 100644 --- a/map65/mainwindow.ui +++ b/map65/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 635 - 512 + 523 @@ -1704,7 +1704,7 @@ p, li { white-space: pre-wrap; } DisplayText QTextBrowser -
displaytext.h
+
widgets/displaytext.h
diff --git a/widgets/BandComboBox.cpp b/widgets/BandComboBox.cpp new file mode 100644 index 000000000..0dc8eba61 --- /dev/null +++ b/widgets/BandComboBox.cpp @@ -0,0 +1,27 @@ +#include "BandComboBox.hpp" + +#include +#include +#include +#include "models/FrequencyList.hpp" + +BandComboBox::BandComboBox (QWidget * parent) + : QComboBox {parent} +{ +} + +// Fix up broken QComboBox item view rendering which doesn't allow for +// a vertical scroll bar in width calculations and ends up eliding the +// item text. +void BandComboBox::showPopup () +{ + auto minimum_width = view ()->sizeHintForColumn (FrequencyList_v2::frequency_mhz_column); + if (count () > maxVisibleItems ()) + { + // for some as yet unknown reason, in FT8 mode the scrollbar + // width is oversize on the first call here + minimum_width += view ()->verticalScrollBar ()->width (); + } + view ()->setMinimumWidth (minimum_width); + QComboBox::showPopup (); +} diff --git a/widgets/BandComboBox.hpp b/widgets/BandComboBox.hpp new file mode 100644 index 000000000..aaad114cb --- /dev/null +++ b/widgets/BandComboBox.hpp @@ -0,0 +1,16 @@ +#ifndef BAND_COMBO_BOX_HPP__ +#define BAND_COMBO_BOX_HPP__ + +#include + +class BandComboBox + : public QComboBox +{ +public: + explicit BandComboBox (QWidget * = nullptr); + +private: + void showPopup () override; +}; + +#endif diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui index 8f787d5ae..a07e79570 100644 --- a/widgets/mainwindow.ui +++ b/widgets/mainwindow.ui @@ -644,7 +644,7 @@ QPushButton[state="ok"] { - + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> @@ -661,7 +661,7 @@ QPushButton[state="ok"] { QComboBox::NoInsert
- QComboBox::AdjustToMinimumContentsLength + QComboBox::AdjustToMinimumContentsLengthWithIcon @@ -3434,7 +3434,7 @@ Double-click to reset to the standard 73 message DisplayText - QTextEdit + QTextBrowser
widgets/displaytext.h
@@ -3468,6 +3468,11 @@ Double-click to reset to the standard 73 message QPushButton
widgets/DoubleClickablePushButton.hpp
+ + BandComboBox + QComboBox +
widgets/BandComboBox.hpp
+
decodedTextBrowser