creating-mewui-controls
БесплатноБез исполняемых скриптовНе проверенCreates custom MewUI controls with proper measure, arrange, render, and input handling. Use when building new interactive controls, extending existing…
от christian289★ 42 звезды на GitHubОб этом скилле
Control Base Classes
| Base | Use Case |
|---|---|
Control |
Interactive elements (buttons, inputs) |
ContentControl |
Single-child containers |
Panel |
Multi-child layouts |
Basic Control Structure
public class MyButton : Control
{
private bool _isPressed;
// Property with invalidation
public string Text
{
get;
set
{
if (field != value)
{
field = value;
InvalidateMeasure();
}
}
} = "";
// Enable focus by overriding (not setting property)
public override bool Focusable => true;
// Measure: calculate desired size
protected override Size MeasureContent(Size availableSize)
{
var factory = GetGraphicsFactory();
using var ctx = factory.CreateMeasurementContext(GetDpi());
var textSize = ctx.MeasureText(Text, GetFont());
return new Size(textSize.Width + Padding.Horizontal, textSize.Height + Padding.Vertical);
}
// Render: draw the control
protected override void OnRender(IGraphicsContext context)
{
var bounds = new Rect(0, 0, Bounds.Width, Bounds.Height);
var bgColor = _isPressed ? Theme.Palette.ButtonPressedBackground
: IsMouseOver ? Theme.Palette.ButtonHoverBackground
: Theme.Palette.ButtonFace;
context.FillRoundedRectangle(bounds, 4, 4, bgColor);
context.DrawRoundedRectangle(bounds, 4, 4, Theme.Palette.BorderColor, 1);
context.DrawText(Text, bounds, GetFont(), Foreground,
TextAlignment.Center, TextAlignment.Center, TextWrapping.NoWrap);
}
}
Input Handling
// Mouse - note: MouseEventArgs, not MouseButtonEventArgs
protected override void OnMouseDown(MouseEventArgs e)
{
if (e.LeftButton)
{
_isPressed = true;
// Capture via Window
var root = FindVisualRoot();
if (root is Window window)
window.CaptureMouse(this);
InvalidateVisual();
e.Handled = true;
}
}
protected override void OnMouseUp(MouseEventArgs e)
{
if (_isPressed)
{
_isPressed = false;
var root = FindVisualRoot();
if (root is Window window)
window.ReleaseMouseCapture();
if (IsMouseOver) Click?.Invoke(this, EventArgs.Empty);
InvalidateVisual();
}
}
// Keyboard
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.Key == Key.Space || e.Key == Key.Enter)
{
Click?.Invoke(this, EventArgs.Empty);
e.Handled = true;
}
}
Adding Binding Support
private ValueBinding<string>? _textBinding;
public void SetTextBinding(Func<string> get, Action<string>? set = null,
Action<Action>? subscribe = null, Action<Action>? unsubscribe = null)
{
_textBinding?.Dispose();
_textBinding = new ValueBinding<string>(get, set, subscribe, unsubscribe, () => Text = get());
// RegisterBinding is internal - use within MewUI assembly
Text = get();
}
Fluent Extensions
public static class MyButtonExtensions
{
public static MyButton Text(this MyButton btn, string text) { btn.Text = text; return btn; }
public static MyButton OnClick(this MyButton btn, Action handler) { btn.Click += (s,e) => handler(); return btn; }
public static MyButton BindText(this MyButton btn, ObservableValue<string> src)
{
btn.SetTextBinding(() => src.Value, v => src.Value = v,
h => src.Changed += h, h => src.Changed -= h);
return btn;
}
}
Input details: See input-handling.md ContentControl pattern: See content-control.md
Установить creating-mewui-controls в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл creating-mewui-controls?
Creates custom MewUI controls with proper measure, arrange, render, and input handling. Use when building new interactive controls, extending existing controls, or implementing custom rendering.
Как установить скилл creating-mewui-controls?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл creating-mewui-controls запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic