Commit graph

4 commits

Author SHA1 Message Date
Stephen Lyons
dd487dc94b
Improve: make filler widget size in toolbars user settable (#9332)
#### Brief overview of PR changes/additions
Replace code that tried to offset the first button in a toolbar by one
extra "space" every time it is saved by a settable variable that can add
zero to one less than the number of rows/columns that a toolbar has.

The maximum value for this and the control in the editor is
automatically set to be that one less every time the number of
rows/columns is changed, and the control disabled should the other one
be set to less that 2. It seems that it is possible to set the number of
rows/columns to zero and it looks as though, many years ago, it was
possible to use that zero value to disable the use of a `QGridLayout`
for the toolbar and instead allow the buttons to have a manually/custom
layout. The code with reproducing the manual layout seems to have
persisted but that to allow it to be modified looks to have disappeared.
That bares further investigation.

#### Motivation for adding to Mudlet
With the introduction of autosaving in the editor it is no longer
reasonable to change the layout every time something in a toolbar is
edited causing things to be saved - and relying on the end-user not ever
touching the arrangement in the editor window. Instead this knob can be
used to set it explicitly.

There is no provision in the Lua API for this "knob" in this PR because
the current Button/Menu/Toolbar implementation in the Lua subsystem is
seriously borked/incomplete. A major overhaul of that is intended for a
future PR!

#### Other info (issues closed, discussion etc)
Also:
* Make members of `TAction` class that have getters/setters `private:`.
* Make the text in the editor for toolbars: "Number of columns/rows
(depending on orientation):" actually change to match the setting for
the selected orientation.
* Move the `QLineEdit` to show the file name for the button icon into
the appropriate `QGroupBox` and add a `QLabel` for it - but keep them
hidden for now. This feature was disabled (without reason?) in
4e651d55fd which removed the button that
was used to select a file to provide an icon however the reproduction of
icons on buttons and menus was never removed. Previously the `QLineEdit`
was used in a read-only mode to display (until it was shrunk to a zero
size before this change) the file chosen.

I intend to re-enable this functionality in the future.

---------

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
2026-08-04 23:18:32 +01:00
Vadim Peretokin
b6738dd8c2
infrastructure: Apply clang-format to all CPP files (#8804)
#### Brief overview of PR changes/additions
Ran clang-format on all 134 CPP files in src/ using the project's
.clang-format config

#### Motivation for adding to Mudlet
Ensures consistent code formatting across the codebase.

#### Other info (issues closed, discussion etc)
None

**Test case:** Build the project and verify it compiles successfully.
2026-01-19 18:10:44 +01:00
Vadim Peretokin
04523e5518
infrastructure: Guard undo/redo debug messages behind compile flag (#8760)
#### Brief overview of PR changes/additions
- Wrap all `qWarning()` and `qDebug()` statements in undo/redo command
files with `#if defined(DEBUG_UNDO_REDO)` guards
- Affects EditorDeleteItemCommand, EditorModifyPropertyCommand,
EditorAddItemCommand, EditorUndoStack

#### Motivation for adding to Mudlet
Prevents debug spam in console output during normal usage while keeping
messages available when explicitly enabled for development.

#### Other info (issues closed, discussion etc)
**Test case:** Build and run Mudlet, perform undo/redo operations in the
editor - no debug messages should appear in console. Enable
`DEBUG_UNDO_REDO` in CMakeLists.txt to verify messages still work when
needed.

Co-authored-by: Vadim Peretokin <vadi2@users.noreply.github.com>
2026-01-08 08:37:34 +01:00
Vadim Peretokin
a3bfcfd031
Add: undo/redo for Mudlet editor (#8469)
<!-- Keep the title short & concise so anyone non-technical can
understand it,
     the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Adds undo/redo for Mudlet editor - allows you to undo
adding/changing/deleting triggers, aliases and so on. This PR also adds
visual tests that can be run inside the `Mudlet self-test` profile, and
they are hooked up to run in the CI pipeline automatically. The deletion
confirmation dialog has been itself deleted since we can now undo.
#### Motivation for adding to Mudlet
Long-awaited and often requested feature. Fixes #707 and addresses
#8272.
#### Other info (issues closed, discussion etc)
This test also adds 300+ tests that can be run in the Mudlet self-test
profile (launch it from the CLI using `--profile "Mudlet self-test"`):



https://github.com/user-attachments/assets/f7f10fcc-0129-47f0-ad8c-d54816820d57

/claim #707

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Vadim Peretokin <vadi2@users.noreply.github.com>
Co-authored-by: Zooka <136661366+ZookaOnGit@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-12-11 09:50:15 +05:00