Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored VMenu::ShowMenu and its vicinity. #767

Merged
merged 1 commit into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
MZK 2023-12-29 16:07:42-08:00 - build 6240

1. Refactored `VMenu::ShowMenu` and its vicinity.

--------------------------------------------------------------------------------
drkns 2023-12-29 22:04:10+00:00 - build 6239

Expand Down
10 changes: 4 additions & 6 deletions far/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,6 @@ void Dialog::InitDialogObjects(size_t ID)
static_cast<int>(m_Where.left + Item.X2),
static_cast<int>(m_Where.top + Item.Y2)
});
ListPtr->SetBoxType(SHORT_SINGLE_BOX);

// поле FarDialogItem.Data для DI_LISTBOX используется как верхний заголовок листа
if (!(Item.Flags & DIF_LISTNOBOX) && !DialogMode.Check(DMODE_OBJECTS_CREATED))
Expand Down Expand Up @@ -812,7 +811,6 @@ void Dialog::InitDialogObjects(size_t ID)
{
if (const auto& ListPtr = Item.ListPtr)
{
ListPtr->SetBoxType(SHORT_SINGLE_BOX);
DialogEdit->SetDropDownBox((Item.Flags& DIF_DROPDOWNLIST) != 0);
ListPtr->ChangeFlags(VMENU_WRAPMODE, (Item.Flags& DIF_LISTWRAPMODE) != 0);
ListPtr->ChangeFlags(VMENU_DISABLED, (Item.Flags& DIF_DISABLE) != 0);
Expand Down Expand Up @@ -2034,8 +2032,8 @@ void Dialog::ShowDialog(size_t ID)
if (Item.ListPtr)
{
// Перед отрисовкой спросим об изменении цветовых атрибутов
FarColor RealColors[VMENU_COLOR_COUNT]{};
FarDialogItemColors ListColors{ sizeof(ListColors), 0, VMENU_COLOR_COUNT, RealColors };
vmenu_colors_t RealColors{};
FarDialogItemColors ListColors{ sizeof(ListColors), 0, RealColors.size(), RealColors.data()};
Item.ListPtr->GetColors(&ListColors);

if (DlgProc(DN_CTLCOLORDLGLIST,I,&ListColors))
Expand Down Expand Up @@ -3867,8 +3865,8 @@ int Dialog::SelectFromComboBox(DialogItemEx& CurItem, DlgEdit& EditLine)
DlgProc(DN_DROPDOWNOPENED, m_FocusPos, ToPtr(1));
SetComboBoxPos(&CurItem);
// Перед отрисовкой спросим об изменении цветовых атрибутов
FarColor RealColors[VMENU_COLOR_COUNT]{};
FarDialogItemColors ListColors{ sizeof(ListColors), 0, VMENU_COLOR_COUNT, RealColors };
vmenu_colors_t RealColors{};
FarDialogItemColors ListColors{ sizeof(ListColors), 0, RealColors.size(), RealColors.data()};
ComboBox->SetColors(nullptr);
ComboBox->GetColors(&ListColors);

Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6239
6240
Loading
Loading