From 906297294de3cf42f2e42d20407225ade82c10c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Wed, 20 Apr 2016 01:18:08 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20de=20l'interface=20toolbar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- res/gui.theme | 37 +++++++++++++++++++++++++++++-------- src/toolbar.cpp | 9 ++++++++- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/res/gui.theme b/res/gui.theme index 976abd5..1f0f4a9 100644 --- a/res/gui.theme +++ b/res/gui.theme @@ -1,28 +1,49 @@ +/** + * Feuille de style pour l'interface de Skizzle + */ + +* { + FontName: overpass; + FontSize: 14; + Color: #111111ff; +} + Window { - BackgroundColor: #FFFFFFff; + BackgroundColor: #FFFFFFff; BorderWidth: 0; } ScrolledWindow { BorderWidth: 0; + ScrollbarWidth: 0; } -Button { - Color: #000000ff; +Scrollbar { BorderWidth: 0; - BackgroundColor: #E6E6E6ff; + SliderColor: #B4B4B4ff; + TroughColor: #E6E6E6ff; + StepperArrowColor: #111111ff; + StepperBackgroundColor: #B4B4B4ff; } -Button:PRELIGHT { +Button, RadioButton { + Color: #000000ff; + BackgroundColor: #E6E6E6ff; + + BorderWidth: 0; + Spacing: 10; +} + +Button:PRELIGHT, RadioButton:PRELIGHT { Color: #000000ff; BackgroundColor: #D2D2D2ff; } -Button:ACTIVE { +Button:ACTIVE, RadioButton:ACTIVE { Color: #000000ff; BackgroundColor: #B4B4B4ff; } -* { - Color: #000000ff; +Separator { + Color: #D2D2D2ff; } diff --git a/src/toolbar.cpp b/src/toolbar.cpp index 1a01b97..5e3dd59 100644 --- a/src/toolbar.cpp +++ b/src/toolbar.cpp @@ -29,8 +29,12 @@ Toolbar::Toolbar(Editor& editor) : editor(editor) { toolbar_box->PackEnd(save_button); // ajout des créateurs de blocs + sfg::Alignment::Ptr spacer = sfg::Alignment::Create(); + spacer->SetRequisition(sf::Vector2f(1, 5)); + + toolbar_box->PackEnd(spacer); + toolbar_box->PackEnd(sfg::Label::Create(L"Choix de l'objet")); toolbar_box->PackEnd(sfg::Separator::Create()); - toolbar_box->PackEnd(sfg::Label::Create(L"Type d'objet à placer")); addCreator(L"Bloc normal", std::bind(&Toolbar::createBlock, this)); addCreator(L"Caisse", std::bind(&Toolbar::createMovableBlock, this)); @@ -55,6 +59,9 @@ Toolbar::Toolbar(Editor& editor) : editor(editor) { &Toolbar::createGravityBlock, this, GravityDirection::WEST )); + // on sélectionne le premier créateur par défaut + creators.begin()->first->SetActive(true); + // création de la fenêtre de la barre d'outils scrolled_zone = sfg::ScrolledWindow::Create(); toolbar_window = sfg::Window::Create(sfg::Window::Style::BACKGROUND);