summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorshubham656 <shubham656jain@gmail.com>2020-12-27 03:41:24 +0530
committerJim Raykowski <raykowj@gmail.com>2021-01-14 07:32:01 +0100
commite7842148f5fa6f9af9312cb4b198a4a5340e3d9b (patch)
treee707ef50dbdcebe6e61fcae3e76b2e38328b8f22 /sw
parent9f9798f07f0b56ae474f31ded671cc8da598d244 (diff)
tdf#138843 Show image file type inside image properties dialog
Change-Id: I77adc9c3cc9d3bd62f0f67345b7a025bcad2352a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108361 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx7
-rw-r--r--sw/source/uibase/inc/frmpage.hxx2
-rw-r--r--sw/uiconfig/swriter/ui/picturepage.ui73
3 files changed, 82 insertions, 0 deletions
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 2581e70eb272..5b4c8fb1f5cd 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -63,6 +63,7 @@
#include <strings.hrc>
#include <svx/strings.hrc>
#include <svx/dialmgr.hxx>
+#include <svx/graphichelper.hxx>
#include <sfx2/filedlghelper.hxx>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
@@ -2314,6 +2315,8 @@ SwGrfExtPage::SwGrfExtPage(weld::Container* pPage, weld::DialogController* pCont
, m_xCtlAngle(new svx::DialControl)
, m_xCtlAngleWin(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", *m_xCtlAngle))
, m_xBmpWin(new weld::CustomWeld(*m_xBuilder, "preview", m_aBmpWin))
+ // tdf#138843 place holder for the graphic type
+ , m_xLabelGraphicType(m_xBuilder->weld_label("label-graphic-type"))
{
m_aBmpWin.SetBitmapEx(BitmapEx(RID_BMP_PREVIEW_FALLBACK));
@@ -2434,7 +2437,10 @@ void SwGrfExtPage::ActivatePage(const SfxItemSet& rSet)
}
const Graphic* pGrf = rBrush.GetGraphic(referer);
if( pGrf )
+ {
m_aBmpWin.SetGraphic( *pGrf );
+ m_xLabelGraphicType->set_label(GraphicHelper::GetImageType(*pGrf));
+ }
}
m_xConnectED->save_value();
@@ -2544,6 +2550,7 @@ IMPL_LINK_NOARG(SwGrfExtPage, BrowseHdl, weld::Button&, void)
Graphic aGraphic;
(void)GraphicFilter::LoadGraphic(m_xGrfDlg->GetPath(), OUString(), aGraphic);
m_aBmpWin.SetGraphic(aGraphic);
+ m_xLabelGraphicType->set_label(GraphicHelper::GetImageType(aGraphic));
bool bEnable = GraphicType::Bitmap == aGraphic.GetType() ||
GraphicType::GdiMetafile == aGraphic.GetType();
diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx
index 077e088b0bc2..63d6e5bf1e78 100644
--- a/sw/source/uibase/inc/frmpage.hxx
+++ b/sw/source/uibase/inc/frmpage.hxx
@@ -221,6 +221,8 @@ class SwGrfExtPage : public SfxTabPage
std::unique_ptr<weld::CustomWeld> m_xCtlAngleWin;
std::unique_ptr<weld::CustomWeld> m_xBmpWin;
+ // tdf#138843 add place holder for the graphic type
+ std::unique_ptr<weld::Label> m_xLabelGraphicType;
// handler for mirroring
DECL_LINK(MirrorHdl, weld::ToggleButton&, void);
diff --git a/sw/uiconfig/swriter/ui/picturepage.ui b/sw/uiconfig/swriter/ui/picturepage.ui
index df6c0c12e5c2..87eec3bac33d 100644
--- a/sw/uiconfig/swriter/ui/picturepage.ui
+++ b/sw/uiconfig/swriter/ui/picturepage.ui
@@ -389,6 +389,79 @@
<property name="width">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkFrame" id="infoframe">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid" id="grid3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</property>
+ <property name="row_spacing">3</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label15">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="picturepage|label15">Type:</property>
+ <property name="single_line_mode">True</property>
+ <property name="xalign">0</property>
+ <accessibility>
+ <relation type="label-for" target="label-graphic-type"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label-graphic-type">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="label">???</property>
+ <property name="xalign">0</property>
+ <accessibility>
+ <relation type="labelled-by" target="label15"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="picturepage|label16">Image Information</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
<child internal-child="accessible">
<object class="AtkObject" id="PicturePage-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="picturepage|extended_tip|PicturePage">Specify the flip and the link options for the selected image.</property>