[Libreoffice-commits] .: 3 commits - cui/source cui/uiconfig cui/UI_cui.mk
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Jan 25 04:43:56 PST 2013
cui/UI_cui.mk | 3
cui/source/dialogs/dlgname.cxx | 32 --
cui/source/inc/dlgname.hxx | 6
cui/uiconfig/ui/messbox.ui | 109 ++++++++
cui/uiconfig/ui/namedialog.ui | 402 -------------------------------
cui/uiconfig/ui/objectnamedialog.ui | 121 +++++++++
cui/uiconfig/ui/objecttitledescdialog.ui | 164 ++++++++++++
7 files changed, 417 insertions(+), 420 deletions(-)
New commits:
commit fbe878da6216028f5943b7863be366adfa0be4fc
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 25 12:25:19 2013 +0000
hand rolled dynamic positioning code can go now
Change-Id: If30c91ea3828f8e4d8ed4c5ac95697fb2817d68f
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index 2b824f2..c841771 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -46,20 +46,6 @@ SvxNameDialog::SvxNameDialog( Window* pWindow, const String& rName, const String
pEdtName->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
ModifyHdl(&pEdtName);
pEdtName->SetModifyHdl(LINK(this, SvxNameDialog, ModifyHdl));
-
- // dynamic height of the description field
- Size aSize = pFtDescription->GetSizePixel();
- long nTxtWidth = pFtDescription->GetCtrlTextWidth( rDesc );
- if ( nTxtWidth > aSize.Width() )
- {
- long nLines = Min( ( nTxtWidth / (aSize.Width()+1) + 1 ), MAX_DESCRIPTION_LINES );
- long nHeight = aSize.Height();
- aSize.Height() = nHeight * nLines;
- pFtDescription->SetSizePixel( aSize );
- Point aPnt = pEdtName->GetPosPixel();
- aPnt.Y() += ( aSize.Height() - nHeight );
- pEdtName->SetPosPixel( aPnt );
- }
}
IMPL_LINK_NOARG(SvxNameDialog, ModifyHdl)
@@ -130,8 +116,9 @@ SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(
|*
\************************************************************************/
-SvxMessDialog::SvxMessDialog( Window* pWindow, const String& rText, const String& rDesc, Image* pImg ) :
- ModalDialog ( pWindow, "MessBox", "cui/ui/messbox.ui" )
+SvxMessDialog::SvxMessDialog( Window* pWindow, const String& rText, const String& rDesc, Image* pImg )
+ : ModalDialog(pWindow, "MessBox", "cui/ui/messbox.ui")
+ , pImage(NULL)
{
get(pBtn1, "mess_box_btn1");
get(pBtn2, "mess_box_btn2");
@@ -142,8 +129,6 @@ SvxMessDialog::SvxMessDialog( Window* pWindow, const String& rText, const String
pImage = new Image( *pImg );
pFtImage->SetImage( *pImage );
pFtImage->SetStyle( ( pFtImage->GetStyle()/* | WB_NOTABSTOP */) & ~WB_3DLOOK );
- pFtImage->SetPosSizePixel( LogicToPixel( Point( 3, 6 ), MAP_APPFONT ),
- pFtImage->GetImage().GetSizePixel() );
pFtImage->Show();
}
@@ -156,8 +141,7 @@ SvxMessDialog::SvxMessDialog( Window* pWindow, const String& rText, const String
SvxMessDialog::~SvxMessDialog()
{
- if( pImage )
- delete pImage;
+ delete pImage;
}
/*************************************************************************/
diff --git a/cui/uiconfig/ui/messbox.ui b/cui/uiconfig/ui/messbox.ui
index c40db71..fc7a45a 100644
--- a/cui/uiconfig/ui/messbox.ui
+++ b/cui/uiconfig/ui/messbox.ui
@@ -75,6 +75,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
+ <property name="padding">12</property>
<property name="position">0</property>
</packing>
</child>
commit 4c05804b2ee2e98c1f2652f88283815a43e9d75e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 25 12:16:06 2013 +0000
split up into one dialog per .ui
Change-Id: I5473ef07abb1f96aed4cfd96d4fa436ec2f13e64
diff --git a/cui/UI_cui.mk b/cui/UI_cui.mk
index c260e11..d2d7d8b 100644
--- a/cui/UI_cui.mk
+++ b/cui/UI_cui.mk
@@ -20,10 +20,13 @@ $(eval $(call gb_UI_add_uifiles,cui,\
cui/uiconfig/ui/insertplugin \
cui/uiconfig/ui/insertrowcolumn \
cui/uiconfig/ui/macroselectordialog \
+ cui/uiconfig/ui/messbox \
cui/uiconfig/ui/namedialog \
cui/uiconfig/ui/numberingformatpage \
cui/uiconfig/ui/numberingoptionspage \
cui/uiconfig/ui/numberingpositionpage \
+ cui/uiconfig/ui/objectnamedialog \
+ cui/uiconfig/ui/objecttitledescdialog \
cui/uiconfig/ui/personalization_tab \
cui/uiconfig/ui/pickbulletpage \
cui/uiconfig/ui/pickgraphicpage \
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index e6541bd..2b824f2 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -77,9 +77,9 @@ IMPL_LINK_NOARG(SvxNameDialog, ModifyHdl)
SvxObjectNameDialog::SvxObjectNameDialog(
Window* pWindow,
const String& rName) :
- ModalDialog ( pWindow, "ObjectNameDialog", "cui/ui/namedialog.ui" )
+ ModalDialog ( pWindow, "ObjectNameDialog", "cui/ui/objectnamedialog.ui" )
{
- get(pBtnOK, "object_name_ok");
+ get(pBtnOK, "ok");
get(pEdtName, "object_name_entry");
// set name
pEdtName->SetText(rName);
@@ -108,7 +108,7 @@ SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(
Window* pWindow,
const String& rTitle,
const String& rDescription) :
- ModalDialog ( pWindow, "ObjectTitleDescDialog", "cui/ui/namedialog.ui" )
+ ModalDialog ( pWindow, "ObjectTitleDescDialog", "cui/ui/objecttitledescdialog.ui" )
{
get(pEdtTitle, "object_title_entry");
get(pEdtDescription, "desc_entry");
@@ -131,7 +131,7 @@ SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(
\************************************************************************/
SvxMessDialog::SvxMessDialog( Window* pWindow, const String& rText, const String& rDesc, Image* pImg ) :
- ModalDialog ( pWindow, "MessBox", "cui/ui/namedialog.ui" )
+ ModalDialog ( pWindow, "MessBox", "cui/ui/messbox.ui" )
{
get(pBtn1, "mess_box_btn1");
get(pBtn2, "mess_box_btn2");
diff --git a/cui/uiconfig/ui/messbox.ui b/cui/uiconfig/ui/messbox.ui
new file mode 100644
index 0000000..c40db71
--- /dev/null
+++ b/cui/uiconfig/ui/messbox.ui
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="MessBox">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox6">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area6">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="mess_box_btn1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="mess_box_btn2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkImage" id="mess_box_image">
+ <property name="can_focus">False</property>
+ <property name="valign">center</property>
+ <property name="stock">gtk-missing-image</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="mess_box_description">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">mess_box_btn1</action-widget>
+ <action-widget response="0">mess_box_btn2</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/cui/uiconfig/ui/namedialog.ui b/cui/uiconfig/ui/namedialog.ui
index 85cbc48..5837621 100644
--- a/cui/uiconfig/ui/namedialog.ui
+++ b/cui/uiconfig/ui/namedialog.ui
@@ -1,110 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
- <object class="GtkDialog" id="MessBox">
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox6">
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area6">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="mess_box_btn1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="mess_box_btn2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="mess_box_cancel">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkImage" id="mess_box_image">
- <property name="can_focus">False</property>
- <property name="valign">center</property>
- <property name="stock">gtk-missing-image</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="mess_box_description">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="0">mess_box_btn1</action-widget>
- <action-widget response="0">mess_box_btn2</action-widget>
- <action-widget response="0">mess_box_cancel</action-widget>
- </action-widgets>
- </object>
<object class="GtkDialog" id="NameDialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
@@ -223,293 +119,4 @@
<action-widget response="0">help</action-widget>
</action-widgets>
</object>
- <object class="GtkDialog" id="ObjectNameDialog">
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Name</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox3">
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area3">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="object_name_help">
- <property name="label">gtk-help</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- <property name="secondary">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="object_name_ok">
- <property name="label">gtk-ok</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="object_name_cancel">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="object_name_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Name</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">name_entry</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="object_name_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">â¢</property>
- <property name="width_chars">55</property>
- <property name="invisible_char_set">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="0">object_name_help</action-widget>
- <action-widget response="-3">object_name_ok</action-widget>
- <action-widget response="0">object_name_cancel</action-widget>
- </action-widgets>
- </object>
- <object class="GtkAdjustment" id="adjustment1">
- <property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
- <object class="GtkDialog" id="ObjectTitleDescDialog">
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Description</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox5">
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area5">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="object_title_desc_help">
- <property name="label">gtk-help</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- <property name="secondary">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="object_title_desc_ok">
- <property name="label">gtk-ok</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="object_title_desc_cancel">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="object_title_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Title</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">object_title_entry</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="object_title_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">â¢</property>
- <property name="width_chars">55</property>
- <property name="invisible_char_set">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="desc_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Description</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="vscrollbar_policy">always</property>
- <property name="shadow_type">in</property>
- <child>
- <object class="GtkTextView" id="desc_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="vadjustment">adjustment1</property>
- <property name="wrap_mode">word</property>
- <property name="buffer">textbuffer1</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="0">object_title_desc_help</action-widget>
- <action-widget response="-3">object_title_desc_ok</action-widget>
- <action-widget response="0">object_title_desc_cancel</action-widget>
- </action-widgets>
- </object>
- <object class="GtkAdjustment" id="adjustment2">
- <property name="upper">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
- <object class="GtkTextBuffer" id="textbuffer1">
- <property name="text">
-
-
-
-</property>
- </object>
</interface>
diff --git a/cui/uiconfig/ui/objectnamedialog.ui b/cui/uiconfig/ui/objectnamedialog.ui
new file mode 100644
index 0000000..3195147
--- /dev/null
+++ b/cui/uiconfig/ui/objectnamedialog.ui
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="ObjectNameDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Name</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox3">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area3">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="object_name_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Name</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="object_name_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">â¢</property>
+ <property name="width_chars">55</property>
+ <property name="invisible_char_set">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">help</action-widget>
+ <action-widget response="-3">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/cui/uiconfig/ui/objecttitledescdialog.ui b/cui/uiconfig/ui/objecttitledescdialog.ui
new file mode 100644
index 0000000..7ee7223
--- /dev/null
+++ b/cui/uiconfig/ui/objecttitledescdialog.ui
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="ObjectTitleDescDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Description</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox5">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area5">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="object_title_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Title</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">object_title_entry</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="object_title_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">â¢</property>
+ <property name="width_chars">55</property>
+ <property name="invisible_char_set">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="desc_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Description</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="vscrollbar_policy">always</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="desc_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="wrap_mode">word</property>
+ <property name="buffer">textbuffer1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">help</action-widget>
+ <action-widget response="-3">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkTextBuffer" id="textbuffer1">
+ <property name="text">
+
+
+
+</property>
+ </object>
+</interface>
commit 18a0d02e076c77d2f07f01bc4ccec358661a82b3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 25 12:03:07 2013 +0000
some minor .ui conversion nits
ObjectNameDialog:
- Lets make it resizeable. Set a "width in chars" on the edit box to make it
wide enough, that way we don't have to about setting a size request
in pixels
ObjectTitleNameDialog
- Lets make it resizeable, as above.
- The original had a scrollbar, so added a scrolledwindow to it with
always vertically scroll
- For the textview to give it a default height, rather than using
pixels I let it take its width by expand to the above edit widget width
- For its height, added a non-translated text buffer with 5 blank lines
and tweaked the ctor to set that as its permanent height request
- GtkTextView maps to VclMultiLineEdit instead of "MultiLineEdit"
its a corner case, they should be equivalent, so just changed
MultiLineEdit to VclMultiLineEdit
NameDialog:
- width requests as above
- set name_entry as the mnemonic widget of name_entry
MessBox:
- I set the label to be vertically centered for the resizeable case
Change-Id: I9ab9eb76aa64b4d7eaf1c9a738f9c29cd7f7820b
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index a3af8bd..e6541bd 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -112,6 +112,8 @@ SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(
{
get(pEdtTitle, "object_title_entry");
get(pEdtDescription, "desc_entry");
+ //lock height to initial height
+ pEdtDescription->set_height_request(pEdtDescription->get_preferred_size().Height());
// set title & desc
pEdtTitle->SetText(rTitle);
pEdtDescription->SetText(rDescription);
diff --git a/cui/source/inc/dlgname.hxx b/cui/source/inc/dlgname.hxx
index 99c89db..ab9c3d8 100644
--- a/cui/source/inc/dlgname.hxx
+++ b/cui/source/inc/dlgname.hxx
@@ -24,9 +24,7 @@
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
-
-// #i68101#
-#include <svtools/svmedit.hxx>
+#include <vcl/vclmedit.hxx> // #i68101#
/// Dialog for editing a name
class SvxNameDialog : public ModalDialog
@@ -115,7 +113,7 @@ private:
Edit* pEdtTitle;
// description
- MultiLineEdit* pEdtDescription;
+ VclMultiLineEdit* pEdtDescription;
// buttons
OKButton* pBtnOK;
diff --git a/cui/uiconfig/ui/namedialog.ui b/cui/uiconfig/ui/namedialog.ui
index d0a7d83..85cbc48 100644
--- a/cui/uiconfig/ui/namedialog.ui
+++ b/cui/uiconfig/ui/namedialog.ui
@@ -83,7 +83,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="yalign">0</property>
</object>
<packing>
<property name="expand">True</property>
@@ -107,12 +106,9 @@
</action-widgets>
</object>
<object class="GtkDialog" id="NameDialog">
- <property name="width_request">475</property>
- <property name="height_request">120</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Name</property>
- <property name="resizable">False</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
@@ -120,44 +116,44 @@
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
- <property name="height_request">120</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="help">
- <property name="label">gtk-help</property>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">0</property>
+ <property name="secondary">True</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="ok">
- <property name="label">gtk-ok</property>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">0</property>
+ <property name="position">1</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="cancel">
- <property name="label">gtk-cancel</property>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -166,8 +162,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
- <property name="secondary">True</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
@@ -190,7 +185,9 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
+ <property name="use_underline">True</property>
<property name="wrap">True</property>
+ <property name="mnemonic_widget">name_entry</property>
</object>
<packing>
<property name="expand">False</property>
@@ -203,6 +200,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">â¢</property>
+ <property name="width_chars">55</property>
</object>
<packing>
<property name="expand">False</property>
@@ -220,18 +218,15 @@
</object>
</child>
<action-widgets>
- <action-widget response="0">help</action-widget>
<action-widget response="-3">ok</action-widget>
<action-widget response="0">cancel</action-widget>
+ <action-widget response="0">help</action-widget>
</action-widgets>
</object>
<object class="GtkDialog" id="ObjectNameDialog">
- <property name="width_request">475</property>
- <property name="height_request">120</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Name</property>
- <property name="resizable">False</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox3">
@@ -322,6 +317,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">â¢</property>
+ <property name="width_chars">55</property>
<property name="invisible_char_set">True</property>
</object>
<packing>
@@ -351,11 +347,9 @@
<property name="page_increment">10</property>
</object>
<object class="GtkDialog" id="ObjectTitleDescDialog">
- <property name="width_request">475</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Description</property>
- <property name="resizable">False</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox5">
@@ -446,6 +440,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">â¢</property>
+ <property name="width_chars">55</property>
<property name="invisible_char_set">True</property>
</object>
<packing>
@@ -461,7 +456,6 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">_Description</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">desc_entry</property>
</object>
<packing>
<property name="expand">False</property>
@@ -470,12 +464,20 @@
</packing>
</child>
<child>
- <object class="GtkTextView" id="desc_entry">
- <property name="height_request">88</property>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="vadjustment">adjustment1</property>
- <property name="wrap_mode">word</property>
+ <property name="vscrollbar_policy">always</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="desc_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="vadjustment">adjustment1</property>
+ <property name="wrap_mode">word</property>
+ <property name="buffer">textbuffer1</property>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">True</property>
@@ -503,4 +505,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkTextBuffer" id="textbuffer1">
+ <property name="text">
+
+
+
+</property>
+ </object>
</interface>
More information about the Libreoffice-commits
mailing list