Skip to content

Commit

Permalink
Fix gram info dropdown: LT-21584 Part2 (#173)
Browse files Browse the repository at this point in the history
Fix behavior of grammatical info dropdown in the New Entry dialogue.

- Correct the variable used to overwrite width in ShowDropDownBox()
in the case that width is explicitly specified for the listbox.
- Specify DropDownWidth for the MainPOS dropdown to match the
default width for popuptree.
- The affixtypes dropdown is meant to match button width,
so the DropDownWidth should not be explicitly set.
  • Loading branch information
aror92 authored Oct 4, 2024
1 parent 133ae42 commit e9130cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Src/Common/Controls/Widgets/FwComboBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1069,8 +1069,8 @@ protected void ShowDropDownBox()
}
else
{
//m_comboListBox.FormWidth = this.Size.Width;
sz.Width = Width;
// If the programmer set an explicit width for the list box, that width is stored in DropDownWidth.
sz.Width = DropDownWidth;
}

if (sz != m_dropDownBox.Form.Size)
Expand Down
2 changes: 1 addition & 1 deletion Src/Common/Controls/Widgets/PopupTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ protected override Size DefaultSize
{
get
{
return new Size(300, 600);
return new Size(300, 400);
// Previously, used (120, 200) for the default size.
// Width set to 120 lets the popuptree dropdown match the width of the box that it drops down from,
// but this doesn't allow enough space to view trees that contain several layers.
Expand Down
4 changes: 2 additions & 2 deletions Src/LexText/LexTextControls/MSAGroupBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,6 @@ private void InitializeComponent()
//
this.m_fwcbAffixTypes.AdjustStringHeight = true;
this.m_fwcbAffixTypes.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.m_fwcbAffixTypes.DropDownWidth = 140;
this.m_fwcbAffixTypes.DroppedDown = false;
resources.ApplyResources(this.m_fwcbAffixTypes, "m_fwcbAffixTypes");
this.m_fwcbAffixTypes.Name = "m_fwcbAffixTypes";
Expand All @@ -642,7 +641,8 @@ private void InitializeComponent()
// m_tcMainPOS
//
this.m_tcMainPOS.AdjustStringHeight = true;
this.m_tcMainPOS.DropDownWidth = 140;
// Setting width to match the default width used by popuptree
this.m_tcMainPOS.DropDownWidth = 300;
this.m_tcMainPOS.DroppedDown = false;
resources.ApplyResources(this.m_tcMainPOS, "m_tcMainPOS");
this.m_tcMainPOS.Name = "m_tcMainPOS";
Expand Down

0 comments on commit e9130cf

Please sign in to comment.