diff options
| author | Manuel de la Pena <manuel@canonical.com> | 2012-10-17 12:07:26 +0200 |
|---|---|---|
| committer | Manuel de la Pena <manuel@canonical.com> | 2012-10-17 12:07:26 +0200 |
| commit | dd348813edb1aef6828457e4918eef4634052e43 (patch) | |
| tree | dcdec9d2f1442872d46b5a73c1d744f0e62a86ab /unity-shared | |
| parent | 5d0b0e32c720e7dcc6e0ea3b93c4a66d0c111cc4 (diff) | |
Removed not needed layout and used gtlib::String over the C api.
(bzr r2791.8.11)
Diffstat (limited to 'unity-shared')
| -rw-r--r-- | unity-shared/TextInput.cpp | 13 | ||||
| -rw-r--r-- | unity-shared/TextInput.h | 1 |
2 files changed, 2 insertions, 12 deletions
diff --git a/unity-shared/TextInput.cpp b/unity-shared/TextInput.cpp index 647d386e3..fc1d894b3 100644 --- a/unity-shared/TextInput.cpp +++ b/unity-shared/TextInput.cpp @@ -118,12 +118,6 @@ void TextInput::Init() layout_->SetSpaceBetweenChildren(SPACE_BETWEEN_ENTRY_AND_HIGHLIGHT); SetLayout(layout_); - entry_layout_ = new nux::HLayout(NUX_TRACKER_LOCATION); - entry_layout_->SetLeftAndRightPadding(0, 10); - layout_->AddLayout(entry_layout_); - - entry_layout_->SetSpaceBetweenChildren(SPACE_BETWEEN_SPINNER_AND_TEXT); - nux::HLayout* hint_layout = new nux::HLayout(NUX_TRACKER_LOCATION); hint_ = new nux::StaticCairoText(" "); @@ -143,7 +137,7 @@ void TextInput::Init() layered_layout_->AddLayer(pango_entry_); layered_layout_->SetPaintAll(true); layered_layout_->SetActiveLayerN(1); - entry_layout_->AddView(layered_layout_, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX); + layout_->AddView(layered_layout_, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX); sig_manager_.Add<void, GtkSettings*, GParamSpec*>(gtk_settings_get_default(), "notify::gtk-font-name", sigc::mem_fun(this, &TextInput::OnFontChanged)); @@ -184,11 +178,8 @@ void TextInput::OnFontChanged(GtkSettings* settings, GParamSpec* pspec) void TextInput::OnInputHintChanged() { - gchar* tmp = g_markup_escape_text(input_hint().c_str(), -1); - + glib::String tmp((gchar*)input_hint().c_str()); hint_->SetText(tmp); - - g_free(tmp); } void TextInput::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) diff --git a/unity-shared/TextInput.h b/unity-shared/TextInput.h index d02bf29af..e68f29262 100644 --- a/unity-shared/TextInput.h +++ b/unity-shared/TextInput.h @@ -87,7 +87,6 @@ private: std::unique_ptr<nux::AbstractPaintLayer> bg_layer_; std::unique_ptr<nux::AbstractPaintLayer> highlight_layer_; nux::HLayout* layout_; - nux::HLayout* entry_layout_; nux::LayeredLayout* layered_layout_; nux::StaticCairoText* hint_; IMTextEntry* pango_entry_; |
