center text

This commit is contained in:
hippoz 2022-07-26 04:47:49 +03:00
parent 90c3a0402a
commit 6015443679
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -1,4 +1,5 @@
#include "GenericStyle.hpp" #include "GenericStyle.hpp"
#include "Painter.hpp"
#include "librsvg/rsvg.h" #include "librsvg/rsvg.h"
#include "raven/Label.hpp" #include "raven/Label.hpp"
#include "cairomm/refptr.h" #include "cairomm/refptr.h"
@ -90,7 +91,7 @@ protected:
layout->slot_pixel(24); // name (text) layout->slot_pixel(24); // name (text)
add<SvgWidget>("folder-adwaita.svg"); add<SvgWidget>("folder-adwaita.svg");
auto label = add<Raven::Label>(m_name); auto label = add<Raven::Label>(m_name, Raven::PaintTextAlign::Center);
label->rect().set_max_width(rect().width()); label->rect().set_max_width(rect().width());
label->rect().set_max_height(24); label->rect().set_max_height(24);
set_did_init(true); set_did_init(true);
@ -122,7 +123,6 @@ public:
: Raven::ScrollContainer() {} : Raven::ScrollContainer() {}
void update() { void update() {
std::cout << "update(): path: " << m_current_path << std::endl;
window()->start_batch(); window()->start_batch();
m_target->clear_children(); m_target->clear_children();
for (const auto &entry : std::filesystem::directory_iterator(m_current_path)) { for (const auto &entry : std::filesystem::directory_iterator(m_current_path)) {