Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
G
geany
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
geany
Commits
6c15dd47
Kaydet (Commit)
6c15dd47
authored
May 29, 2012
tarafından
Colomban Wendling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Drop GEANY_WRAP_LABEL_GET_PRIVATE() macro
üst
232919a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
geanywraplabel.c
src/geanywraplabel.c
+9
-16
No files found.
src/geanywraplabel.c
Dosyayı görüntüle @
6c15dd47
...
...
@@ -31,9 +31,6 @@
#define GEANY_WRAP_LABEL_GET_PRIVATE(obj) (GEANY_WRAP_LABEL(obj)->priv)
struct
_GeanyWrapLabelClass
{
GtkLabelClass
parent_class
;
...
...
@@ -73,14 +70,11 @@ static void geany_wrap_label_class_init(GeanyWrapLabelClass *klass)
static
void
geany_wrap_label_init
(
GeanyWrapLabel
*
self
)
{
GeanyWrapLabelPrivate
*
priv
;
self
->
priv
=
G_TYPE_INSTANCE_GET_PRIVATE
(
self
,
GEANY_WRAP_LABEL_TYPE
,
GeanyWrapLabelPrivate
);
priv
=
self
->
priv
;
priv
->
wrap_width
=
0
;
priv
->
wrap_height
=
0
;
self
->
priv
->
wrap_width
=
0
;
self
->
priv
->
wrap_height
=
0
;
g_signal_connect
(
self
,
"notify::label"
,
G_CALLBACK
(
geany_wrap_label_label_notify
),
NULL
);
pango_layout_set_wrap
(
gtk_label_get_layout
(
GTK_LABEL
(
self
)),
PANGO_WRAP_WORD_CHAR
);
...
...
@@ -91,13 +85,12 @@ static void geany_wrap_label_init(GeanyWrapLabel *self)
/* Sets the point at which the text should wrap. */
static
void
geany_wrap_label_set_wrap_width
(
GtkWidget
*
widget
,
gint
width
)
{
GeanyWrapLabel
Private
*
priv
;
GeanyWrapLabel
*
self
=
GEANY_WRAP_LABEL
(
widget
)
;
PangoLayout
*
layout
;
if
(
width
<=
0
)
return
;
priv
=
GEANY_WRAP_LABEL_GET_PRIVATE
(
widget
);
layout
=
gtk_label_get_layout
(
GTK_LABEL
(
widget
));
/*
...
...
@@ -105,11 +98,11 @@ static void geany_wrap_label_set_wrap_width(GtkWidget *widget, gint width)
* or not we've changed the width.
*/
pango_layout_set_width
(
layout
,
width
*
PANGO_SCALE
);
pango_layout_get_pixel_size
(
layout
,
NULL
,
&
priv
->
wrap_height
);
pango_layout_get_pixel_size
(
layout
,
NULL
,
&
self
->
priv
->
wrap_height
);
if
(
priv
->
wrap_width
!=
width
)
if
(
self
->
priv
->
wrap_width
!=
width
)
{
priv
->
wrap_width
=
width
;
self
->
priv
->
wrap_width
=
width
;
gtk_widget_queue_resize
(
widget
);
}
}
...
...
@@ -118,9 +111,9 @@ static void geany_wrap_label_set_wrap_width(GtkWidget *widget, gint width)
/* updates the wrap width when the label text changes */
static
void
geany_wrap_label_label_notify
(
GObject
*
object
,
GParamSpec
*
pspec
,
gpointer
data
)
{
GeanyWrapLabel
Private
*
priv
=
GEANY_WRAP_LABEL_GET_PRIVATE
(
object
);
GeanyWrapLabel
*
self
=
GEANY_WRAP_LABEL
(
object
);
geany_wrap_label_set_wrap_width
(
GTK_WIDGET
(
object
),
priv
->
wrap_width
);
geany_wrap_label_set_wrap_width
(
GTK_WIDGET
(
object
),
self
->
priv
->
wrap_width
);
}
...
...
@@ -129,7 +122,7 @@ static void geany_wrap_label_label_notify(GObject *object, GParamSpec *pspec, gp
static
void
geany_wrap_label_size_request
(
GtkWidget
*
widget
,
GtkRequisition
*
req
)
{
req
->
width
=
0
;
req
->
height
=
GEANY_WRAP_LABEL
_GET_PRIVATE
(
widget
)
->
wrap_height
;
req
->
height
=
GEANY_WRAP_LABEL
(
widget
)
->
priv
->
wrap_height
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment