clang-format header sorting conf fix. Some spacing and order of
include/declaration changes.
This commit is contained in:
parent
299b39ad28
commit
5f341149fa
|
@ -34,14 +34,14 @@ EmptyLineBeforeAccessModifier: Always
|
||||||
FixNamespaceComments: false
|
FixNamespaceComments: false
|
||||||
IncludeBlocks: Regroup
|
IncludeBlocks: Regroup
|
||||||
IncludeCategories:
|
IncludeCategories:
|
||||||
- Regex: '<[[:alnum:]._]+>'
|
|
||||||
Priority: -10
|
|
||||||
- Regex: '^<fontconfig'
|
- Regex: '^<fontconfig'
|
||||||
Priority: -5
|
Priority: -5
|
||||||
- Regex: '^<SDL'
|
- Regex: '^<SDL'
|
||||||
Priority: -5
|
Priority: -5
|
||||||
- Regex: '^<basic_widgets/'
|
- Regex: '^<basic_widgets/'
|
||||||
Priority: 0
|
Priority: 0
|
||||||
|
- Regex: '<[[:alnum:]._]+>'
|
||||||
|
Priority: -10
|
||||||
- Regex: '^".*"$'
|
- Regex: '^".*"$'
|
||||||
Priority: 5
|
Priority: 5
|
||||||
IndentCaseLabels: true
|
IndentCaseLabels: true
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <SDL_pixels.h>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
#include <SDL_pixels.h>
|
||||||
|
|
||||||
#include <basic_widgets/core/type/concepts.hpp>
|
#include <basic_widgets/core/type/concepts.hpp>
|
||||||
|
|
||||||
namespace bwidgets
|
namespace bwidgets
|
||||||
|
|
|
@ -23,11 +23,6 @@ namespace bwidgets
|
||||||
public virtual WidgetImpl
|
public virtual WidgetImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void color_fg(const Color c) override
|
|
||||||
{
|
|
||||||
_input_caption->font_color_fg(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] auto input_text() const -> std::string_view override
|
[[nodiscard]] auto input_text() const -> std::string_view override
|
||||||
{
|
{
|
||||||
return _input_caption->text();
|
return _input_caption->text();
|
||||||
|
@ -38,6 +33,11 @@ namespace bwidgets
|
||||||
_input_caption->text(std::move(txt));
|
_input_caption->text(std::move(txt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void input_text_color(const Color c) override
|
||||||
|
{
|
||||||
|
_input_caption->font_color_fg(c);
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] auto is_valid_input(const std::string_view) const noexcept
|
[[nodiscard]] auto is_valid_input(const std::string_view) const noexcept
|
||||||
-> bool override
|
-> bool override
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define BWIDGETS_EVENT_HANDLER_HPP
|
#define BWIDGETS_EVENT_HANDLER_HPP
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#include <SDL_events.h>
|
#include <SDL_events.h>
|
||||||
|
|
||||||
namespace bwidgets
|
namespace bwidgets
|
||||||
|
|
|
@ -56,6 +56,7 @@ void ButtonImpl::_handle_geometry_change(const SDL_Rect& vp)
|
||||||
const auto txt_size = _caption->size();
|
const auto txt_size = _caption->size();
|
||||||
_caption_area = {center_line(vp.w, txt_size.w), center_line(vp.h, txt_size.h),
|
_caption_area = {center_line(vp.w, txt_size.w), center_line(vp.h, txt_size.h),
|
||||||
txt_size.w, txt_size.h};
|
txt_size.w, txt_size.h};
|
||||||
|
|
||||||
_caption->viewport(rect_offset(_caption_area, vp));
|
_caption->viewport(rect_offset(_caption_area, vp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ void CaptionImpl::render_mode(const Font::RenderMode m)
|
||||||
auto CaptionImpl::size() const noexcept -> Size
|
auto CaptionImpl::size() const noexcept -> Size
|
||||||
{
|
{
|
||||||
if (!_font) return {0, 0};
|
if (!_font) return {0, 0};
|
||||||
|
|
||||||
const auto [w, h] = _font->text_size(_text);
|
const auto [w, h] = _font->text_size(_text);
|
||||||
return {w + 2 * margins.w, h + 2 * margins.h};
|
return {w + 2 * margins.w, h + 2 * margins.h};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue